Skip to content
This repository has been archived by the owner on Apr 10, 2021. It is now read-only.

other param named configuration #65

Closed
ctaggart opened this issue Oct 21, 2020 · 2 comments · Fixed by Azure/azure-sdk-for-rust#55 or #67
Closed

other param named configuration #65

ctaggart opened this issue Oct 21, 2020 · 2 comments · Fixed by Azure/azure-sdk-for-rust#55 or #67

Comments

@ctaggart
Copy link
Owner

maintenance can't compile because another param is named config

    pub async fn create_or_update(
        configuration: &crate::Configuration,
        subscription_id: &str,
        resource_group_name: &str,
        resource_name: &str,
        configuration: &MaintenanceConfiguration,
    ) -> std::result::Result<MaintenanceConfiguration, create_or_update::Error> {

May beoperation_config: OperationConfig?

@rylev
Copy link
Contributor

rylev commented Oct 21, 2020

Choosing a different name isn't really solving the issue, it's just moving it around. Renaming the type to OperationConfig will break if there's ever another type named OperationConfig. I think instead we should come up with some way to unambiguously refer to the Configuration we mean. Right now we're using use crate::* which would make this difficult, but if we move away from that, we should be able to refer to the configuration in a way that is unambiguous.

@ctaggart
Copy link
Owner Author

@rylev, looks like I already removed use crate::* from operations.rs. I'll remove it from models.rs. The actual conflict above is the two parameters named configuration:

  • configuration: &crate::Configuration,
  • configuration: &MaintenanceConfiguration,

This will still break if a parameter is named operationConfig. Practically, however, there are none with that name currently and it is against the Azure spec guidelines to use abbreviations like Config in the specs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants