Skip to content

Commit

Permalink
Merge pull request #21 from arkworks-rs/clippy-fixes
Browse files Browse the repository at this point in the history
Additional 1.85 clippy fixes
  • Loading branch information
WizardOfMenlo authored Nov 29, 2024
2 parents 58ca31b + 346acdf commit bdec8c4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions nimue/src/arthur.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<'a, U: Unit, H: DuplexHash<U>> Arthur<'a, H, U> {
}
}

impl<'a, H: DuplexHash<U>, U: Unit> UnitTranscript<U> for Arthur<'a, H, U> {
impl<H: DuplexHash<U>, U: Unit> UnitTranscript<U> for Arthur<'_, H, U> {
/// Add native elements to the sponge without writing them to the protocol transcript.
#[inline]
fn public_units(&mut self, input: &[U]) -> Result<(), IOPatternError> {
Expand All @@ -76,13 +76,13 @@ impl<'a, H: DuplexHash<U>, U: Unit> UnitTranscript<U> for Arthur<'a, H, U> {
}
}

impl<'a, H: DuplexHash<U>, U: Unit> core::fmt::Debug for Arthur<'a, H, U> {
impl<H: DuplexHash<U>, U: Unit> core::fmt::Debug for Arthur<'_, H, U> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_tuple("Arthur").field(&self.safe).finish()
}
}

impl<'a, H: DuplexHash<u8>> ByteReader for Arthur<'a, H, u8> {
impl<H: DuplexHash<u8>> ByteReader for Arthur<'_, H, u8> {
/// Read the next `input.len()` bytes from the transcript and return them.
#[inline]
fn fill_next_bytes(&mut self, input: &mut [u8]) -> Result<(), IOPatternError> {
Expand Down
2 changes: 1 addition & 1 deletion nimue/src/plugins/ark/iopattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ where

fn challenge_bytes(self, count: usize, label: &str) -> Self {
let n = crate::plugins::random_bits_in_random_modp(Fp::<C, N>::MODULUS) / 8;
self.squeeze((count + n - 1) / n, label)
self.squeeze(count.div_ceil(n), label)
}
}

Expand Down
10 changes: 5 additions & 5 deletions nimue/src/plugins/ark/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use super::{FieldReader, GroupReader};
use crate::traits::*;
use crate::{Arthur, DuplexHash, ProofResult};

impl<'a, F, H> FieldReader<F> for Arthur<'a, H>
impl<F, H> FieldReader<F> for Arthur<'_, H>
where
F: Field,
H: DuplexHash,
Expand All @@ -25,7 +25,7 @@ where
}
}

impl<'a, G, H> GroupReader<G> for Arthur<'a, H>
impl<G, H> GroupReader<G> for Arthur<'_, H>
where
G: CurveGroup,
H: DuplexHash,
Expand All @@ -42,7 +42,7 @@ where
}
}

impl<'a, H, C, const N: usize> FieldReader<Fp<C, N>> for Arthur<'a, H, Fp<C, N>>
impl<H, C, const N: usize> FieldReader<Fp<C, N>> for Arthur<'_, H, Fp<C, N>>
where
C: FpConfig<N>,
H: DuplexHash<Fp<C, N>>,
Expand All @@ -53,7 +53,7 @@ where
}
}

impl<'a, P, H, C, const N: usize> GroupReader<EdwardsCurve<P>> for Arthur<'a, H, Fp<C, N>>
impl<P, H, C, const N: usize> GroupReader<EdwardsCurve<P>> for Arthur<'_, H, Fp<C, N>>
where
C: FpConfig<N>,
H: DuplexHash<Fp<C, N>>,
Expand All @@ -69,7 +69,7 @@ where
}
}

impl<'a, P, H, C, const N: usize> GroupReader<SWCurve<P>> for Arthur<'a, H, Fp<C, N>>
impl<P, H, C, const N: usize> GroupReader<SWCurve<P>> for Arthur<'_, H, Fp<C, N>>
where
C: FpConfig<N>,
H: DuplexHash<Fp<C, N>>,
Expand Down
2 changes: 1 addition & 1 deletion nimue/src/plugins/ark/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ where
}
}

impl<'a, H, C, const N: usize> ByteReader for Arthur<'a, H, Fp<C, N>>
impl<H, C, const N: usize> ByteReader for Arthur<'_, H, Fp<C, N>>
where
H: DuplexHash<Fp<C, N>>,
C: FpConfig<N>,
Expand Down

0 comments on commit bdec8c4

Please sign in to comment.