From a655bdac52165b5bb8c5f3ed1503a7c1fe218fb2 Mon Sep 17 00:00:00 2001 From: nasa Date: Fri, 5 Apr 2019 18:34:24 +0900 Subject: [PATCH] Fix clippy warning (#755) --- actix-http/src/body.rs | 2 +- actix-http/src/cookie/secure/key.rs | 4 ++-- actix-http/src/cookie/secure/private.rs | 2 +- actix-http/src/cookie/secure/signed.rs | 2 +- awc/src/request.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/actix-http/src/body.rs b/actix-http/src/body.rs index 85717ba8..0d015b2e 100644 --- a/actix-http/src/body.rs +++ b/actix-http/src/body.rs @@ -359,7 +359,7 @@ where } fn poll_next(&mut self) -> Poll, Error> { - self.stream.poll().map_err(|e| e.into()) + self.stream.poll().map_err(std::convert::Into::into) } } diff --git a/actix-http/src/cookie/secure/key.rs b/actix-http/src/cookie/secure/key.rs index 3b8a0af7..4e74f6e7 100644 --- a/actix-http/src/cookie/secure/key.rs +++ b/actix-http/src/cookie/secure/key.rs @@ -68,8 +68,8 @@ impl Key { encryption_key.copy_from_slice(&both_keys[SIGNED_KEY_LEN..]); Key { - signing_key: signing_key, - encryption_key: encryption_key, + signing_key, + encryption_key, } } diff --git a/actix-http/src/cookie/secure/private.rs b/actix-http/src/cookie/secure/private.rs index 32368730..e5974376 100644 --- a/actix-http/src/cookie/secure/private.rs +++ b/actix-http/src/cookie/secure/private.rs @@ -37,7 +37,7 @@ impl<'a> PrivateJar<'a> { let mut key_array = [0u8; KEY_LEN]; key_array.copy_from_slice(key.encryption()); PrivateJar { - parent: parent, + parent, key: key_array, } } diff --git a/actix-http/src/cookie/secure/signed.rs b/actix-http/src/cookie/secure/signed.rs index 5a4ffb76..1b1799cf 100644 --- a/actix-http/src/cookie/secure/signed.rs +++ b/actix-http/src/cookie/secure/signed.rs @@ -31,7 +31,7 @@ impl<'a> SignedJar<'a> { #[doc(hidden)] pub fn new(parent: &'a mut CookieJar, key: &Key) -> SignedJar<'a> { SignedJar { - parent: parent, + parent, key: SigningKey::new(HMAC_DIGEST, key.signing()), } } diff --git a/awc/src/request.rs b/awc/src/request.rs index b96b39e2..32ab7d78 100644 --- a/awc/src/request.rs +++ b/awc/src/request.rs @@ -414,7 +414,7 @@ impl ClientRequest { } // user agent - if !self.head.headers.contains_key(&header::USER_AGENT) { + if !self.head.headers.contains_key(header::USER_AGENT) { self.head.headers.insert( header::USER_AGENT, HeaderValue::from_static(concat!("awc/", env!("CARGO_PKG_VERSION"))),