Skip to content

Commit dbc9dbd

Browse files
author
andrew
committed
Clippy
1 parent b0072fd commit dbc9dbd

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

src/decoding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ fn verify_signature_body(
229229
return Err(new_error(ErrorKind::InvalidSignature));
230230
}
231231

232-
return Ok(());
232+
Ok(())
233233
}
234234

235235
/// Verify signature of a JWT, and return header object and raw payload

src/encoding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ pub fn encode_jws<T: Serialize>(
153153
Ok(Jws {
154154
protected: encoded_header,
155155
payload: encoded_claims,
156-
signature: signature,
156+
signature,
157157
_pd: Default::default(),
158158
})
159159
}

src/header.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ use crate::errors::Result;
88
use crate::jwk::Jwk;
99
use crate::serialization::b64_decode;
1010

11-
const ZIP_SERIAL_DEFLATE: &'static str = "DEF";
12-
const ENC_A128CBC_HS256: &'static str = "A128CBC-HS256";
13-
const ENC_A192CBC_HS384: &'static str = "A192CBC-HS384";
14-
const ENC_A256CBC_HS512: &'static str = "A256CBC-HS512";
15-
const ENC_A128GCM: &'static str = "A128GCM";
16-
const ENC_A192GCM: &'static str = "A192GCM";
17-
const ENC_A256GCM: &'static str = "A256GCM";
11+
const ZIP_SERIAL_DEFLATE: &str = "DEF";
12+
const ENC_A128CBC_HS256: &str = "A128CBC-HS256";
13+
const ENC_A192CBC_HS384: &str = "A192CBC-HS384";
14+
const ENC_A256CBC_HS512: &str = "A256CBC-HS512";
15+
const ENC_A128GCM: &str = "A128GCM";
16+
const ENC_A192GCM: &str = "A192GCM";
17+
const ENC_A256GCM: &str = "A256GCM";
1818

1919
/// Encryption algorithm for encrypted payloads.
2020
///
2121
/// Defined in [RFC7516#4.1.2](https://datatracker.ietf.org/doc/html/rfc7516#section-4.1.2).
2222
///
2323
/// Values defined in [RFC7518#5.1](https://datatracker.ietf.org/doc/html/rfc7518#section-5.1).
2424
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
25-
#[allow(clippy::upper_case_acronyms)]
25+
#[allow(clippy::upper_case_acronyms, non_camel_case_types)]
2626
pub enum Enc {
2727
A128CBC_HS256,
2828
A192CBC_HS384,
@@ -98,10 +98,9 @@ impl<'de> Deserialize<'de> for Zip {
9898
{
9999
let s = String::deserialize(deserializer)?;
100100
match s.as_str() {
101-
ZIP_SERIAL_DEFLATE => return Ok(Zip::Deflate),
102-
_ => (),
101+
ZIP_SERIAL_DEFLATE => Ok(Zip::Deflate),
102+
_ => Ok(Zip::Other(s)),
103103
}
104-
Ok(Zip::Other(s))
105104
}
106105
}
107106

0 commit comments

Comments
 (0)