From fcb4ed9a8f802a47102115c04d5ccc697df3e22d Mon Sep 17 00:00:00 2001 From: Ryan Tate Date: Mon, 19 Aug 2024 20:04:49 -0700 Subject: [PATCH] fix clippy warnings Signed-off-by: Ryan Tate --- src/core/authorization_request/parameters.rs | 6 +++--- src/core/authorization_request/verification/did.rs | 2 +- src/core/metadata/mod.rs | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/core/authorization_request/parameters.rs b/src/core/authorization_request/parameters.rs index 54a1eeb..0dfe80e 100644 --- a/src/core/authorization_request/parameters.rs +++ b/src/core/authorization_request/parameters.rs @@ -215,9 +215,9 @@ impl Deref for Nonce { } } -impl ToString for Nonce { - fn to_string(&self) -> String { - self.0.clone() +impl std::fmt::Display for Nonce { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.0.fmt(f) } } diff --git a/src/core/authorization_request/verification/did.rs b/src/core/authorization_request/verification/did.rs index 2ea7f50..5817881 100644 --- a/src/core/authorization_request/verification/did.rs +++ b/src/core/authorization_request/verification/did.rs @@ -70,7 +70,7 @@ pub async fn verify_with_resolver( .await .context("unable to resolve key from verification method")?; - let _: Json = ssi_claims::jwt::decode_verify(&request_jwt, &*jwk) + let _: Json = ssi_claims::jwt::decode_verify(&request_jwt, &jwk) .context("request signature could not be verified")?; Ok(()) diff --git a/src/core/metadata/mod.rs b/src/core/metadata/mod.rs index 0d83542..45b4f7a 100644 --- a/src/core/metadata/mod.rs +++ b/src/core/metadata/mod.rs @@ -41,6 +41,11 @@ impl WalletMetadata { &self.2 } + /// Returns whether the claim format is supported. + pub fn is_claim_format_supported(&self, designation: &ClaimFormatDesignation) -> bool { + self.vp_formats_supported().0.contains_key(designation) + } + /// The static wallet metadata bound to `openid4vp:`: /// ```json /// {