Skip to content

Commit

Permalink
Fix Clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Jun 24, 2024
1 parent 5e6ddf6 commit c05f6cb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion aead/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ where
type NonceOverhead = U5;
type Counter = u32;
const COUNTER_INCR: u32 = 1;
const COUNTER_MAX: u32 = core::u32::MAX;
const COUNTER_MAX: u32 = u32::MAX;

fn encrypt_in_place(
&self,
Expand Down
1 change: 1 addition & 0 deletions elliptic-curve/src/jwk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ impl FromStr for JwkEcKey {
}
}

#[allow(clippy::to_string_trait_impl)]
impl ToString for JwkEcKey {
fn to_string(&self) -> String {
serde_json::to_string(self).expect("JWK encoding error")
Expand Down
1 change: 1 addition & 0 deletions elliptic-curve/src/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ where
}

#[cfg(feature = "pem")]
#[allow(clippy::to_string_trait_impl)]
impl<C> ToString for PublicKey<C>
where
C: AssociatedOid + CurveArithmetic,
Expand Down
6 changes: 4 additions & 2 deletions elliptic-curve/src/scalar/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ where
// While this method isn't constant-time, the attacker shouldn't learn
// anything about unrelated outputs so long as `rng` is a secure `CryptoRng`.
loop {
// TODO: remove after `Field::random` switches to `&mut impl RngCore`
#[allow(clippy::needless_borrows_for_generic_args)]
if let Some(result) = Self::new(Field::random(&mut rng)).into() {
break result;
}
Expand Down Expand Up @@ -270,11 +272,11 @@ where
Scalar<C>: Reduce<I, Bytes = Self::Bytes> + ReduceNonZero<I>,
{
fn reduce_nonzero(n: I) -> Self {
Self::reduce(n)
<Self as Reduce<I>>::reduce(n)
}

fn reduce_nonzero_bytes(bytes: &Self::Bytes) -> Self {
Self::reduce_bytes(bytes)
<Self as Reduce<I>>::reduce_bytes(bytes)
}
}

Expand Down
3 changes: 3 additions & 0 deletions password-hash/src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ pub enum Encoding {
/// - sha256_crypt,
/// - sha512_crypt,
/// - md5_crypt
///
/// ```text
/// [.-9] [A-Z] [a-z]
/// 0x2e-0x39, 0x41-0x5a, 0x61-0x7a
/// ```
ShaCrypt,
}

Expand Down

0 comments on commit c05f6cb

Please sign in to comment.