fix/format: various code that's escaped the linter (#2667)

_Every once in a while I run clippy and the pre-commit checks on
everything b/c stuff seems to fall through the cracks._

- fix: various code that's escaped the linter
- format: various code that's escaped the formatter
- update: `chrono` because a test was using a method only available in
v0.4.23 _(I don't know why that didn't fail in CI)_


_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
This commit is contained in:
Zelda Hessler 2023-05-03 10:46:18 -05:00 committed by GitHub
parent e1cf72e52d
commit c75807ce37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 33 additions and 35 deletions

View File

@ -778,7 +778,7 @@ mod test {
.get(USER_AGENT)
.expect("UA header should be set");
req.headers()
.get(&X_AMZ_USER_AGENT)
.get(X_AMZ_USER_AGENT)
.expect("UA header should be set");
}
}

View File

@ -183,7 +183,7 @@ mod tests {
let api_metadata = ApiMetadata::new("some-service", "some-version");
let mut config = ConfigBag::base();
config.put(api_metadata.clone());
config.put(api_metadata);
config.put(AppName::new("my_awesome_app").unwrap());
let interceptor = UserAgentInterceptor::new();

View File

@ -638,9 +638,7 @@ mod test {
}
expected.reverse();
assert_eq!(
bag.load::<TestItem>()
.map(|i| i.clone())
.collect::<Vec<_>>(),
bag.load::<TestItem>().cloned().collect::<Vec<_>>(),
expected
);
}

View File

@ -13,7 +13,7 @@ convert-time = ["aws-smithy-types", "time"]
[dependencies]
aws-smithy-types = { path = "../aws-smithy-types", optional = true }
chrono = { version = "0.4.19", optional = true, default-features = false, features = ["std"] }
chrono = { version = "0.4.23", optional = true, default-features = false, features = ["std"] }
time = { version = "0.3.4", optional = true }
[package.metadata.docs.rs]

View File

@ -184,8 +184,8 @@ impl TryFrom<Number> for f32 {
}
#[cfg(test)]
mod number {
use super::*;
mod test {
use super::Number;
use crate::error::{TryFromNumberError, TryFromNumberErrorKind};
macro_rules! to_unsigned_converter_tests {