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

Add lints to `aws-config` (#1421)

* Add `unreachable_pub` lint to `aws-config`
* Add `missing_debug_implementations` lint to `aws-config`
* Add `rust_2018_idioms` lint to `aws-config`
* Update changelog
parent 3c1b71f3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -16,3 +16,9 @@ message = "Fix bug in profile file credential provider where a missing `default`
references = ["aws-sdk-rust#547", "smithy-rs#1458"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "rcoh"

[[aws-sdk-rust]]
message = "Add `Debug` implementation to several types in `aws-config`"
references = ["smithy-rs#1421"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "jdisanti"
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ impl<T, E> ExpiringCache<T, E>
where
    T: Clone,
{
    pub fn new(buffer_time: Duration) -> Self {
    pub(crate) fn new(buffer_time: Duration) -> Self {
        ExpiringCache {
            buffer_time,
            value: Arc::new(RwLock::new(OnceCell::new())),
@@ -64,7 +64,7 @@ where
    /// and the others will await that thread's result rather than multiple refreshes occurring.
    /// The function given to acquire a value future, `f`, will not be called
    /// if another thread is chosen to load the value.
    pub async fn get_or_load<F, Fut>(&self, f: F) -> Result<T, E>
    pub(crate) async fn get_or_load<F, Fut>(&self, f: F) -> Result<T, E>
    where
        F: FnOnce() -> Fut,
        Fut: Future<Output = Result<(T, SystemTime), E>>,
@@ -75,7 +75,7 @@ where
    }

    /// If the value is expired, clears the cache. Otherwise, yields the current value.
    pub async fn yield_or_clear_if_expired(&self, now: SystemTime) -> Option<T> {
    pub(crate) async fn yield_or_clear_if_expired(&self, now: SystemTime) -> Option<T> {
        // Short-circuit if the value is not expired
        if let Some((value, expiry)) = self.value.read().await.get() {
            if !expired(*expiry, self.buffer_time, now) {
+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ impl CredentialProcessProvider {
/// Keys are case insensitive.
pub(crate) fn parse_credential_process_json_credentials(
    credentials_response: &str,
) -> Result<RefreshableCredentials, InvalidJsonCredentials> {
) -> Result<RefreshableCredentials<'_>, InvalidJsonCredentials> {
    let mut version = None;
    let mut access_key_id = None;
    let mut secret_access_key = None;
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ pub fn default_provider() -> Builder {
}

/// Default provider builder for [`AppName`]
#[derive(Default)]
#[derive(Debug, Default)]
pub struct Builder {
    env_provider: EnvironmentVariableAppNameProvider,
    profile_file: app_name::Builder,
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ impl ProvideCredentials for DefaultCredentialsChain {
}

/// Builder for [`DefaultCredentialsChain`](DefaultCredentialsChain)
#[derive(Default)]
#[derive(Debug, Default)]
pub struct Builder {
    profile_file_builder: crate::profile::credentials::Builder,
    web_identity_builder: crate::web_identity_token::Builder,
Loading