From 8d260e599ffa3940413f46738b1489a6d0dd6a20 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sat, 23 Jul 2022 02:48:28 +0100 Subject: [PATCH] clippy --- actix-router/src/resource_path.rs | 2 +- actix-web/src/middleware/compress.rs | 1 + actix-web/src/request.rs | 2 +- actix-web/src/server.rs | 2 ++ actix-web/src/types/path.rs | 1 + actix-web/src/types/query.rs | 1 + 6 files changed, 7 insertions(+), 2 deletions(-) diff --git a/actix-router/src/resource_path.rs b/actix-router/src/resource_path.rs index 00eb0927c..45948aa2a 100644 --- a/actix-router/src/resource_path.rs +++ b/actix-router/src/resource_path.rs @@ -27,7 +27,7 @@ impl<'a> ResourcePath for &'a str { impl ResourcePath for bytestring::ByteString { fn path(&self) -> &str { - &*self + self } } diff --git a/actix-web/src/middleware/compress.rs b/actix-web/src/middleware/compress.rs index 203e41ab2..51b44c6ef 100644 --- a/actix-web/src/middleware/compress.rs +++ b/actix-web/src/middleware/compress.rs @@ -319,6 +319,7 @@ mod tests { .to_request(); let res = test::call_service(&app, req).await; assert_eq!(res.status(), StatusCode::OK); + #[allow(clippy::mutable_key_type)] let vary_headers = res.headers().get_all(header::VARY).collect::>(); assert!(vary_headers.contains(&HeaderValue::from_static("x-test"))); assert!(vary_headers.contains(&HeaderValue::from_static("accept-encoding"))); diff --git a/actix-web/src/request.rs b/actix-web/src/request.rs index d26488e2b..2998c7010 100644 --- a/actix-web/src/request.rs +++ b/actix-web/src/request.rs @@ -253,7 +253,7 @@ impl HttpRequest { #[inline] pub fn connection_info(&self) -> Ref<'_, ConnectionInfo> { if !self.extensions().contains::() { - let info = ConnectionInfo::new(self.head(), &*self.app_config()); + let info = ConnectionInfo::new(self.head(), self.app_config()); self.extensions_mut().insert(info); } diff --git a/actix-web/src/server.rs b/actix-web/src/server.rs index 169eafab0..9c5076d36 100644 --- a/actix-web/src/server.rs +++ b/actix-web/src/server.rs @@ -401,6 +401,8 @@ where .into_factory() .map_err(|err| err.into().error_response()); + // false positive lint (?) + #[allow(clippy::significant_drop_in_scrutinee)] let acceptor_config = match c.tls_handshake_timeout { Some(dur) => TlsAcceptorConfig::default().handshake_timeout(dur), None => TlsAcceptorConfig::default(), diff --git a/actix-web/src/types/path.rs b/actix-web/src/types/path.rs index 34c335ba9..a90c912f6 100644 --- a/actix-web/src/types/path.rs +++ b/actix-web/src/types/path.rs @@ -134,6 +134,7 @@ where /// ``` #[derive(Clone, Default)] pub struct PathConfig { + #[allow(clippy::type_complexity)] err_handler: Option Error + Send + Sync>>, } diff --git a/actix-web/src/types/query.rs b/actix-web/src/types/query.rs index 97d17123d..e71b886f2 100644 --- a/actix-web/src/types/query.rs +++ b/actix-web/src/types/query.rs @@ -169,6 +169,7 @@ impl FromRequest for Query { /// ``` #[derive(Clone, Default)] pub struct QueryConfig { + #[allow(clippy::type_complexity)] err_handler: Option Error + Send + Sync>>, }