From 6f9cc14b9ed7c4f8c4c4241b32aa707f03be0da9 Mon Sep 17 00:00:00 2001 From: Lukas Wagner Date: Tue, 8 Aug 2023 10:01:44 +0200 Subject: [PATCH] clippy fix: redundant closure See: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure Signed-off-by: Lukas Wagner --- proxmox-openid/src/lib.rs | 2 +- proxmox-schema/src/de/mod.rs | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/proxmox-openid/src/lib.rs b/proxmox-openid/src/lib.rs index d6ed89bf..c2b73c9d 100644 --- a/proxmox-openid/src/lib.rs +++ b/proxmox-openid/src/lib.rs @@ -107,7 +107,7 @@ impl PrivateAuthState { impl OpenIdAuthenticator { pub fn discover(config: &OpenIdConfig, redirect_url: &str) -> Result { let client_id = ClientId::new(config.client_id.clone()); - let client_key = config.client_key.clone().map(|key| ClientSecret::new(key)); + let client_key = config.client_key.clone().map(ClientSecret::new); let issuer_url = IssuerUrl::new(config.issuer_url.clone())?; let provider_metadata = CoreProviderMetadata::discover(&issuer_url, http_client)?; diff --git a/proxmox-schema/src/de/mod.rs b/proxmox-schema/src/de/mod.rs index 80d92fda..8cb37619 100644 --- a/proxmox-schema/src/de/mod.rs +++ b/proxmox-schema/src/de/mod.rs @@ -109,7 +109,7 @@ impl<'de, 'i> SchemaDeserializer<'de, 'i> { if !IN_PROPERTY_STRING.with(|v| v.get()) { schema .check_constraints(&self.input) - .map_err(|err| Error::invalid(err))?; + .map_err(Error::invalid)?; } match self.input { Cow3::Original(input) => visitor.visit_borrowed_str(input), @@ -175,9 +175,7 @@ impl<'de, 'i> de::Deserializer<'de> for SchemaDeserializer<'de, 'i> { .parse() .map_err(|_| Error::msg(format!("not an integer: {:?}", self.input)))?; - schema - .check_constraints(value) - .map_err(|err| Error::invalid(err))?; + schema.check_constraints(value).map_err(Error::invalid)?; let value: i64 = i64::try_from(value) .map_err(|_| Error::invalid("isize did not fit into i64"))?; @@ -194,9 +192,7 @@ impl<'de, 'i> de::Deserializer<'de> for SchemaDeserializer<'de, 'i> { .parse() .map_err(|_| Error::msg(format!("not a valid number: {:?}", self.input)))?; - schema - .check_constraints(value) - .map_err(|err| Error::invalid(err))?; + schema.check_constraints(value).map_err(Error::invalid)?; visitor.visit_f64(value) }