From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 94E1CAB75 for ; Tue, 8 Aug 2023 10:02:07 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D58DB675C for ; Tue, 8 Aug 2023 10:02:05 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 8 Aug 2023 10:02:04 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id D9E0E436BD for ; Tue, 8 Aug 2023 10:02:03 +0200 (CEST) From: Lukas Wagner To: pbs-devel@lists.proxmox.com Date: Tue, 8 Aug 2023 10:01:42 +0200 Message-Id: <20230808080153.79587-4-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230808080153.79587-1-l.wagner@proxmox.com> References: <20230808080153.79587-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -1.452 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy FSL_BULK_SIG 0.001 Bulk signature with no Unsubscribe KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RAZOR2_CF_RANGE_51_100 1.886 Razor2 gives confidence level above 50% RAZOR2_CHECK 0.922 Listed in Razor2 (http://razor.sf.net/) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox 04/15] clippy fix: needless borrow X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Aug 2023 08:02:07 -0000 See: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow Signed-off-by: Lukas Wagner --- proxmox-openid/src/lib.rs | 2 +- proxmox-rest-server/src/rest.rs | 4 ++-- proxmox-schema/src/de/cow3.rs | 2 +- proxmox-schema/src/de/mod.rs | 2 +- proxmox-tfa/src/totp.rs | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/proxmox-openid/src/lib.rs b/proxmox-openid/src/lib.rs index 825975b..d6ed89b 100644 --- a/proxmox-openid/src/lib.rs +++ b/proxmox-openid/src/lib.rs @@ -221,7 +221,7 @@ impl OpenIdAuthenticator { private_auth_state: &PrivateAuthState, ) -> Result { let (id_token_claims, userinfo_claims) = - self.verify_authorization_code(&code, &private_auth_state)?; + self.verify_authorization_code(code, private_auth_state)?; let mut data = serde_json::to_value(id_token_claims)?; diff --git a/proxmox-rest-server/src/rest.rs b/proxmox-rest-server/src/rest.rs index cffcedc..b4f35aa 100644 --- a/proxmox-rest-server/src/rest.rs +++ b/proxmox-rest-server/src/rest.rs @@ -946,7 +946,7 @@ impl Formatted { let result = if api_method.protected && rpcenv.env_type == RpcEnvironmentType::PUBLIC { - proxy_protected_request(api_method, parts, body, &peer).await + proxy_protected_request(api_method, parts, body, peer).await } else { handle_api_request(rpcenv, api_method, formatter, parts, body, uri_param).await }; @@ -1051,7 +1051,7 @@ impl Unformatted { let result = if api_method.protected && rpcenv.env_type == RpcEnvironmentType::PUBLIC { - proxy_protected_request(api_method, parts, body, &peer).await + proxy_protected_request(api_method, parts, body, peer).await } else { handle_unformatted_api_request(rpcenv, api_method, parts, body, uri_param).await }; diff --git a/proxmox-schema/src/de/cow3.rs b/proxmox-schema/src/de/cow3.rs index 3044681..73bf8b5 100644 --- a/proxmox-schema/src/de/cow3.rs +++ b/proxmox-schema/src/de/cow3.rs @@ -93,7 +93,7 @@ where ::Owned: Borrow, { fn as_ref(&self) -> &B { - &self + self } } diff --git a/proxmox-schema/src/de/mod.rs b/proxmox-schema/src/de/mod.rs index 804ffcc..80d92fd 100644 --- a/proxmox-schema/src/de/mod.rs +++ b/proxmox-schema/src/de/mod.rs @@ -588,7 +588,7 @@ impl<'de, 'i> de::MapAccess<'de> for MapAccess<'de, 'i> { let (key, schema) = match key { Some(key) => { - let schema = self.schema.lookup(&key); + let schema = self.schema.lookup(key); let key = match str_slice_to_range(&self.input, key) { None => Cow::Owned(key.to_string()), Some(range) => match &self.input { diff --git a/proxmox-tfa/src/totp.rs b/proxmox-tfa/src/totp.rs index 97be715..1827e43 100644 --- a/proxmox-tfa/src/totp.rs +++ b/proxmox-tfa/src/totp.rs @@ -36,12 +36,12 @@ impl StdError for Error { impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { - Error::Generic(e) => f.write_str(&e), - Error::Decode(m, _e) => f.write_str(&m), - Error::Ssl(m, _e) => f.write_str(&m), + Error::Generic(e) => f.write_str(e), + Error::Decode(m, _e) => f.write_str(m), + Error::Ssl(m, _e) => f.write_str(m), Error::UnsupportedAlgorithm(a) => write!(f, "unsupported algorithm: '{a}'"), Error::UnknownParameter(p) => write!(f, "unknown otpauth uri parameter: '{p}'"), - Error::BadParameter(m, _e) => f.write_str(&m), + Error::BadParameter(m, _e) => f.write_str(m), } } } -- 2.39.2