Unverified Commit 548f6ed4 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Fix the hardcoded credentials example in `aws-types` (#1180)

parent bd6b65bd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -64,9 +64,9 @@ jobs:
        - name: Unit Tests
          run: cargo test --all-features
        - name: Docs
          run: cargo doc --no-deps --document-private-items
          run: cargo doc --no-deps --document-private-items --all-features
        - name: Clippy
          run: cargo clippy
          run: cargo clippy --all-features
        - name: Unused Dependencies
          run: cargo +nightly-2022-02-08 udeps
        - name: Additional per-crate checks
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ jobs:
      # windows doesn't support using --check like this
      if: ${{ matrix.os == 'ubuntu-latest' }}
    - name: clippy check
      run: cargo clippy -- -D warnings
      run: cargo clippy --all-features -- -D warnings
      working-directory: ${{ matrix.runtime }}
      # don't bother running Clippy twice, it will have the same results on Windows
      if: ${{ matrix.os == 'ubuntu-latest' }}
+6 −0
Original line number Diff line number Diff line
@@ -250,3 +250,9 @@ remove their trait bounds.
references = ["smithy-rs#1132"]
meta = { "breaking" = true, "tada" = false, "bug" = false }
author = "jdisanti"

[[aws-sdk-rust]]
message = "Fixed example showing how to use hardcoded credentials in `aws-types`"
references = ["smithy-rs#1180"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "jdisanti"
+30 −13
Original line number Diff line number Diff line
@@ -98,8 +98,10 @@ impl Credentials {
    /// implementation is required when wiring these up to a client:
    /// ```rust
    /// use aws_types::Credentials;
    /// # mod dynamodb {
    /// use aws_types::region::Region;
    /// # mod service {
    /// #     use aws_types::credentials::ProvideCredentials;
    /// #     use aws_types::region::Region;
    /// #     pub struct Config;
    /// #     impl Config {
    /// #        pub fn builder() -> Self {
@@ -108,11 +110,26 @@ impl Credentials {
    /// #        pub fn credentials_provider(self, provider: impl ProvideCredentials + 'static) -> Self {
    /// #            self
    /// #        }
    /// #        pub fn region(self, region: Region) -> Self {
    /// #            self
    /// #        }
    /// #        pub fn build(self) -> Config { Config }
    /// #     }
    /// #     pub struct Client;
    /// #     impl Client {
    /// #        pub fn from_conf(config: Config) -> Self {
    /// #            Client
    /// #        }
    /// #     }
    /// # }
    /// # use service::{Config, Client};
    ///
    /// let my_creds = Credentials::from_keys("akid", "secret_key", None);
    /// let conf = dynamodb::Config::builder().credentials_provider(my_creds);
    /// let creds = Credentials::from_keys("akid", "secret_key", None);
    /// let config = Config::builder()
    ///     .credentials_provider(creds)
    ///     .region(Region::new("us-east-1"))
    ///     .build();
    /// let client = Client::from_conf(config);
    /// ```
    #[cfg(feature = "hardcoded-credentials")]
    pub fn from_keys(