Skip to content

Commit

Permalink
Fix Clippy lints (divviup#1020)
Browse files Browse the repository at this point in the history
  • Loading branch information
divergentdave authored and Hannah Davis committed May 3, 2024
1 parent e0de2d7 commit 4017ccc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 28 deletions.
6 changes: 0 additions & 6 deletions src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,6 @@ pub(crate) mod test_utils {
type TryIntoU64Error: std::error::Error;
type TestInteger: Integer + From<Self> + Clone;

fn pow(&self, exp: Self::TestInteger) -> Self;

fn modulus() -> Self::TestInteger;
}

Expand All @@ -957,10 +955,6 @@ pub(crate) mod test_utils {
type TryIntoU64Error = <F::Integer as Integer>::TryIntoU64Error;
type TestInteger = F::Integer;

fn pow(&self, exp: Self::TestInteger) -> Self {
<F as FieldElementWithInteger>::pow(self, exp)
}

fn modulus() -> Self::TestInteger {
<F as FieldElementWithInteger>::modulus()
}
Expand Down
4 changes: 0 additions & 4 deletions src/field/field255.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,6 @@ mod tests {
type IntegerTryFromError = <Self::TestInteger as TryFrom<usize>>::Error;
type TryIntoU64Error = <Self::TestInteger as TryInto<u64>>::Error;

fn pow(&self, _exp: Self::TestInteger) -> Self {
unimplemented!("Field255::pow() is not implemented because it's not needed yet")
}

fn modulus() -> Self::TestInteger {
MODULUS.clone()
}
Expand Down
5 changes: 1 addition & 4 deletions src/flp/gadgets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,7 @@ fn gadget_call_poly_check<F: FftFriendlyFieldElement, G: Gadget<F>>(
gadget: &G,
outp: &[F],
inp: &[Vec<F>],
) -> Result<(), FlpError>
where
G: Gadget<F>,
{
) -> Result<(), FlpError> {
gadget_call_check(gadget, inp.len())?;

for i in 1..inp.len() {
Expand Down
4 changes: 2 additions & 2 deletions src/flp/types/fixedpoint_l2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,9 @@ mod tests {
);
}

fn test_fixed<F: Fixed>(fp_vec: Vec<F>, enc_vec: Vec<u128>)
fn test_fixed<F>(fp_vec: Vec<F>, enc_vec: Vec<u128>)
where
F: CompatibleFloat,
F: Fixed + CompatibleFloat,
{
let n: usize = (F::INT_NBITS + F::FRAC_NBITS).try_into().unwrap();

Expand Down
19 changes: 7 additions & 12 deletions src/vdaf/dummy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,21 @@ impl Vdaf {
}

/// Provide an alternate implementation of [`vdaf::Aggregator::prepare_init`].
pub fn with_prep_init_fn<F: Fn(&AggregationParam) -> Result<(), VdafError>>(
mut self,
f: F,
) -> Self
pub fn with_prep_init_fn<F>(mut self, f: F) -> Self
where
F: 'static + Send + Sync,
F: Fn(&AggregationParam) -> Result<(), VdafError> + Send + Sync + 'static,
{
self.prep_init_fn = Arc::new(f);
self
}

/// Provide an alternate implementation of [`vdaf::Aggregator::prepare_next`].
pub fn with_prep_step_fn<
F: Fn(&PrepareState) -> Result<PrepareTransition<Self, 0, 16>, VdafError>,
>(
mut self,
f: F,
) -> Self
pub fn with_prep_step_fn<F>(mut self, f: F) -> Self
where
F: 'static + Send + Sync,
F: Fn(&PrepareState) -> Result<PrepareTransition<Self, 0, 16>, VdafError>
+ Send
+ Sync
+ 'static,
{
self.prep_step_fn = Arc::new(f);
self
Expand Down

0 comments on commit 4017ccc

Please sign in to comment.