From 1dc8cf6ad56c177e8b13be3dca63ecac0deeb30a Mon Sep 17 00:00:00 2001 From: k-nasa Date: Fri, 5 Apr 2019 11:38:47 +0900 Subject: [PATCH] refactor: redundant field names in struct initialization --- actix-http/src/cookie/secure/key.rs | 4 ++-- actix-http/src/cookie/secure/private.rs | 2 +- actix-http/src/cookie/secure/signed.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actix-http/src/cookie/secure/key.rs b/actix-http/src/cookie/secure/key.rs index 3b8a0af78..4e74f6e78 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 323687303..e59743767 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 5a4ffb76c..1b1799cf4 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()), } }