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

Fix Clippy lints #1020

Merged
merged 1 commit into from
May 2, 2024
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
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