diff --git a/evaluation/case-studies/builder-provider-api.md b/evaluation/case-studies/builder-provider-api.md index d5a424c..c2abcf1 100644 --- a/evaluation/case-studies/builder-provider-api.md +++ b/evaluation/case-studies/builder-provider-api.md @@ -101,7 +101,7 @@ struct DefaultCredentialsChain { impl DefaultCredentialsChain { fn with_custom_credential_source(self, provider: impl ProvideCredentials) { // Coerce `impl ProvideCredentials` to `Box` - Self { provider: Box::new(credentials_source), ..self } + Self { credentials_source: Box::new(provider), ..self } } } ``` @@ -125,7 +125,7 @@ impl DefaultCredentialsChain { provider: impl ProvideCredentials ) { // Coerce `impl ProvideCredentials` to `Box` - Self { provider: Box::new(credentials_source), ..self } + Self { credentials_source: Box::new(provider), ..self } } } ``` @@ -163,4 +163,4 @@ The SDK uses this same idiom several times: ## Future improvements -With AFIDT, we can drop the `ProvideCredentialsDyn` trait and just use `Box` as is. Refactoring the API to use AFIDT is a totally internal-facing change. \ No newline at end of file +With AFIDT, we can drop the `ProvideCredentialsDyn` trait and just use `Box` as is. Refactoring the API to use AFIDT is a totally internal-facing change.