Skip to content

Commit

Permalink
Merge pull request #198 from LLFourn/fix-clippy
Browse files Browse the repository at this point in the history
[📎] Fix clippy
  • Loading branch information
LLFourn authored Dec 22, 2024
2 parents 8132fbe + b571bea commit c22eea3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions ecdsa_fun/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ std = ["alloc"]
alloc = ["secp256kfun/alloc", "sigma_fun?/alloc" ]
serde = ["secp256kfun/serde","sigma_fun?/serde"]
adaptor = ["dep:sigma_fun", "dep:bincode", "dep:rand_chacha"]
bincode = [ "secp256kfun/bincode", "dep:bincode" ]
proptest = ["secp256kfun/proptest"]


Expand Down
4 changes: 2 additions & 2 deletions schnorr_fun/tests/bip340.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static BIP340_CSV: &str = include_str!("./bip340-test-vectors.csv");

struct AuxRng<'a>(&'a [u8]);

impl<'a> rand_core::RngCore for AuxRng<'a> {
impl rand_core::RngCore for AuxRng<'_> {
fn next_u32(&mut self) -> u32 {
rand_core::impls::next_u32_via_fill(self)
}
Expand All @@ -30,7 +30,7 @@ impl<'a> rand_core::RngCore for AuxRng<'a> {
}
}

impl<'a> NonceRng for AuxRng<'a> {
impl NonceRng for AuxRng<'_> {
fn fill_bytes(&self, bytes: &mut [u8]) {
bytes.copy_from_slice(self.0)
}
Expand Down
2 changes: 1 addition & 1 deletion secp256kfun/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl HashInto for u8 {
}
}

impl<'a, T: HashInto + Clone> HashInto for &'a T {
impl<T: HashInto + Clone> HashInto for &T {
fn hash_into(self, hash: &mut impl digest::Update) {
self.clone().hash_into(hash)
}
Expand Down
1 change: 0 additions & 1 deletion secp256kfun/src/marker/zero_choice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ impl ZeroChoice for NonZero {
}

/// A trait to figure out whether the result of a multiplication should be [`Zero`] or [`NonZero`] at compile time.
pub trait DecideZero<ZZ> {
/// If both arguments are `NonZero` then `Out` will be `NonZero`, otherwise `Zero`.
type Out;
Expand Down
8 changes: 4 additions & 4 deletions secp256kfun/src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ pub struct Slice<'a, S = Public> {
secrecy: PhantomData<S>,
}

impl<'a, S> Clone for Slice<'a, S> {
impl<S> Clone for Slice<'_, S> {
fn clone(&self) -> Self {
*self
}
}

impl<'a, S> Copy for Slice<'a, S> {}
impl<S> Copy for Slice<'_, S> {}

impl<'a, 'b, S1, S2> PartialEq<Slice<'b, S2>> for Slice<'a, S1> {
impl<'b, S1, S2> PartialEq<Slice<'b, S2>> for Slice<'_, S1> {
fn eq(&self, rhs: &Slice<'b, S2>) -> bool {
// by default do comparison constant time
self.inner.ct_eq(rhs.inner).into()
Expand Down Expand Up @@ -75,7 +75,7 @@ impl<'a, S> From<&'a [u8]> for Slice<'a, S> {
}
}

impl<'a, S> HashInto for Slice<'a, S> {
impl<S> HashInto for Slice<'_, S> {
fn hash_into(self, hash: &mut impl digest::Update) {
hash.update(self.inner)
}
Expand Down

0 comments on commit c22eea3

Please sign in to comment.