Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Clippy and fix lints #1335

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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