From 4681487d17b5c5c8ed3a8474c9e20eb2f7a9e69c Mon Sep 17 00:00:00 2001 From: okkero Date: Wed, 29 Oct 2025 09:54:57 +0100 Subject: [PATCH] Remove unnecessary Clone bounds from decode functions --- src/decoding.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/decoding.rs b/src/decoding.rs index 6d1fc42f..51d793e7 100644 --- a/src/decoding.rs +++ b/src/decoding.rs @@ -277,7 +277,7 @@ impl TryFrom<&Jwk> for DecodingKey { /// // Claims is a struct that implements Deserialize /// let token_message = decode::(&token, &DecodingKey::from_secret("secret".as_ref()), &Validation::new(Algorithm::HS256)); /// ``` -pub fn decode( +pub fn decode( token: impl AsRef<[u8]>, key: &DecodingKey, validation: &Validation, @@ -303,9 +303,7 @@ pub fn decode( /// Decode a JWT with NO VALIDATION /// /// DANGER: This performs zero validation on the JWT -pub fn insecure_decode( - token: impl AsRef<[u8]>, -) -> Result> { +pub fn insecure_decode(token: impl AsRef<[u8]>) -> Result> { let token = token.as_ref(); let (_, message) = expect_two!(token.rsplitn(2, |b| *b == b'.'));