Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions evaluation/case-studies/builder-provider-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct DefaultCredentialsChain {
impl DefaultCredentialsChain {
fn with_custom_credential_source(self, provider: impl ProvideCredentials) {
// Coerce `impl ProvideCredentials` to `Box<dyn ProvideCredentialsDyn>`
Self { provider: Box::new(credentials_source), ..self }
Self { credentials_source: Box::new(provider), ..self }
}
}
```
Expand All @@ -125,7 +125,7 @@ impl DefaultCredentialsChain {
provider: impl ProvideCredentials<provide_credentials(): Send>
) {
// Coerce `impl ProvideCredentials` to `Box<dyn ProvideCredentialsDyn>`
Self { provider: Box::new(credentials_source), ..self }
Self { credentials_source: Box::new(provider), ..self }
}
}
```
Expand Down Expand Up @@ -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<dyn ProvideCredentials>` as is. Refactoring the API to use AFIDT is a totally internal-facing change.
With AFIDT, we can drop the `ProvideCredentialsDyn` trait and just use `Box<dyn ProvideCredentials>` as is. Refactoring the API to use AFIDT is a totally internal-facing change.