From 38c0b6766e0f2b3d17fabdd3a7274210bfb0f2f8 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 2 Jun 2022 06:29:25 +1200 Subject: [PATCH] Relax aws-sdk dependency versions (#54) Specifying a fixed `0.10` only allows patch updates, which causes issues if trying to use for example `0.12` in a parent project, as handling of major version zero is different to one and up due to semver guarantees. ie. `0.10` is equivalent to `>=0.10.0, <0.11.0` where as `1.10` is equivalent to `>=1.10.0, <2.0.0`. Also fix a couple minor clippy lints while I'm here. Signed-off-by: Thomas Farr --- opensearch/Cargo.toml | 6 +++--- opensearch/src/http/request.rs | 2 +- opensearch/src/http/response.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/opensearch/Cargo.toml b/opensearch/Cargo.toml index df9864e8..481d1862 100644 --- a/opensearch/Cargo.toml +++ b/opensearch/Cargo.toml @@ -40,11 +40,11 @@ serde = { version = "~1", features = ["derive"] } serde_json = "~1" serde_with = "~1" void = "1.0.2" -aws-sigv4 = { version = "0.10", optional = true } -aws-types = { version = "0.10", optional = true } +aws-sigv4 = { version = ">= 0.10", optional = true } +aws-types = { version = ">= 0.10", optional = true } [dev-dependencies] -aws-config = "0.10" +aws-config = ">= 0.10" chrono = { version = "^0.4", features = ["serde"] } clap = "~2" failure = "0.1.5" diff --git a/opensearch/src/http/request.rs b/opensearch/src/http/request.rs index 364fd260..1242b2c6 100644 --- a/opensearch/src/http/request.rs +++ b/opensearch/src/http/request.rs @@ -265,7 +265,7 @@ mod tests { let mut bytes_mut = BytesMut::with_capacity(21); let bytes: &'static [u8] = b"{\"foo\":\"bar\",\"baz\":1}"; let _ = bytes.write(&mut bytes_mut)?; - assert_eq!(&bytes[..], &bytes_mut[..]); + assert_eq!(bytes, &bytes_mut[..]); Ok(()) } diff --git a/opensearch/src/http/response.rs b/opensearch/src/http/response.rs index b73bc5fd..d960d0ae 100644 --- a/opensearch/src/http/response.rs +++ b/opensearch/src/http/response.rs @@ -53,8 +53,8 @@ impl Response { /// Creates a new instance of an Elasticsearch response pub fn new(response: reqwest::Response, method: Method) -> Self { Self { - response: response, - method: method, + response, + method, } } @@ -478,7 +478,7 @@ pub mod tests { Some("Missing mandatory contexts in context query") ); - assert!(error.additional_details().len() > 0); + assert!(!error.additional_details().is_empty()); assert_eq!( error.additional_details().get("phase"), Some(&json!("query"))