Skip to content

Commit

Permalink
Update Clippy and fix lints (#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov authored Aug 7, 2023
1 parent 962daba commit bd87a32
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.60.0
toolchain: 1.71.0
components: clippy
- run: cargo clippy --all --all-features -- -D warnings

Expand Down
1 change: 1 addition & 0 deletions cipher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
)]
#![warn(missing_docs, rust_2018_idioms)]
#![allow(clippy::needless_lifetimes)]

pub use crypto_common;
pub use inout;
Expand Down
2 changes: 1 addition & 1 deletion kem/tests/hpke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl EncappedKey for X25519EncappedKey {
type SenderPublicKey = X25519PublicKey;

fn from_bytes(bytes: &GenericArray<u8, Self::EncappedKeySize>) -> Result<Self, Error> {
Ok(X25519EncappedKey(bytes.clone()))
Ok(X25519EncappedKey(*bytes))
}
}
impl AsRef<[u8]> for X25519EncappedKey {
Expand Down
2 changes: 1 addition & 1 deletion password-hash/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ mod tests {
let mut params = ParamsString::new();
params.add_decimal(name, 1).unwrap();

let err = params.add_decimal(name, 2u32.into()).err().unwrap();
let err = params.add_decimal(name, 2u32).err().unwrap();
assert_eq!(err, Error::ParamNameDuplicated);
}

Expand Down
2 changes: 1 addition & 1 deletion password-hash/tests/hashing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<'a> TryFrom<&PasswordHash<'a>> for StubParams {
}
}

impl<'a> TryFrom<StubParams> for ParamsString {
impl TryFrom<StubParams> for ParamsString {
type Error = Error;

fn try_from(_: StubParams) -> Result<Self> {
Expand Down
4 changes: 1 addition & 3 deletions signature/tests/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ impl TryFrom<&[u8]> for DummySignature {
type Error = Error;

fn try_from(bytes: &[u8]) -> Result<Self, Error> {
Ok(DummySignature(GenericArray::clone_from_slice(
bytes.as_ref(),
)))
Ok(DummySignature(GenericArray::clone_from_slice(bytes)))
}
}

Expand Down

0 comments on commit bd87a32

Please sign in to comment.