Skip to content

builder-provider-api case study: Fix flipped identifiers in examples #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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.