diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23ef625..a5277fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,7 @@ jobs: - windows-latest rust: - stable + - 1.65.0 runs-on: ${{ matrix.os }} steps: - name: Checkout sources @@ -58,6 +59,7 @@ jobs: - windows-latest rust: - stable + - 1.65.0 runs-on: ${{ matrix.os }} steps: - name: Checkout sources diff --git a/Cargo.toml b/Cargo.toml index 1f171bc..c94265b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ include = [ "LICENSE-APACHE", "LICENSE-MIT", ] +rust-version = "1.65" [dependencies] base64ct = { version = "1.5", default-features = false, features = ["alloc"] } diff --git a/src/lib.rs b/src/lib.rs index 63f98bd..c9a4aeb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -310,15 +310,14 @@ impl<'a> UnverifiedJwt<'a> { fn split(jwt: &str) -> Result> { let mut parts = jwt.rsplitn(2, '.'); - let (signature, signed_data) = match (parts.next(), parts.next()) { - (Some(signature), Some(signed_data)) => (signature, signed_data), - _ => return Err(Error::malformed_jwt()), + + let (Some(signature), Some(signed_data)) = (parts.next(), parts.next()) else { + return Err(Error::malformed_jwt()); }; let mut parts = signed_data.rsplitn(3, '.'); - let (claims, header) = match (parts.next(), parts.next(), parts.next()) { - (Some(claims), Some(header), None) => (claims, header), - _ => return Err(Error::malformed_jwt()), + let (Some(claims), Some(header), None) = (parts.next(), parts.next(), parts.next()) else { + return Err(Error::malformed_jwt()); }; Ok(SplitJwt {