Skip to content

Commit

Permalink
fix: clippy complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
ed255 committed May 21, 2024
1 parent c850856 commit 6304585
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
1 change: 1 addition & 0 deletions p3_frontend/src/fwrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ impl<F: PrimeField + Hash + Ord> PrimeField64 for FWrap<F> {
}
}

#[allow(clippy::bool_assert_comparison)]
#[cfg(test)]
mod test {
use super::*;
Expand Down
2 changes: 1 addition & 1 deletion p3_frontend/src/symbolic_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use alloc::vec;
use alloc::vec::Vec;

use p3_air::{Air, AirBuilder};
use p3_air::AirBuilder;
use p3_field::Field;
use p3_matrix::dense::RowMajorMatrix;

Expand Down
23 changes: 9 additions & 14 deletions p3_frontend/src/symbolic_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ impl<F: Field> Product<F> for SymbolicExpression<F> {
}
}

#[allow(clippy::bool_assert_comparison)]
#[cfg(test)]
mod test {
use super::*;
Expand Down Expand Up @@ -391,41 +392,35 @@ mod test {
let w2 = E::from(V::new_query(false, 2));
let f = F::two();
assert_eq!(format!("{}", w1.clone() + w2.clone()), "(w1 + w2)");
assert_eq!(format!("{}", w1.clone() + f.clone()), "(w1 + 2)");
assert_eq!(format!("{}", w1.clone() + f), "(w1 + 2)");
let mut v = w1.clone();
v += w2.clone();
v += f.clone();
v += f;
assert_eq!(format!("{}", v), "((w1 + w2) + 2)");
assert_eq!(
format!("{}", [w1.clone(), w2.clone()].into_iter().sum::<E>()),
"(w1 + w2)"
);
assert_eq!(
format!("{}", [f.clone(), f.clone()].into_iter().sum::<E>()),
"(2 + 2)"
);
assert_eq!(format!("{}", [f, f].into_iter().sum::<E>()), "(2 + 2)");

assert_eq!(format!("{}", w1.clone() - w2.clone()), "(w1 - w2)");
assert_eq!(format!("{}", w1.clone() - f.clone()), "(w1 - 2)");
assert_eq!(format!("{}", w1.clone() - f), "(w1 - 2)");
let mut v = w1.clone();
v -= w2.clone();
v -= f.clone();
v -= f;
assert_eq!(format!("{}", v), "((w1 - w2) - 2)");
assert_eq!(format!("{}", -w1.clone()), "-(w1)");

assert_eq!(format!("{}", w1.clone() * w2.clone()), "w1 * w2");
assert_eq!(format!("{}", w1.clone() * f.clone()), "w1 * 2");
assert_eq!(format!("{}", w1.clone() * f), "w1 * 2");
let mut v = w1.clone();
v *= w2.clone();
v *= f.clone();
v *= f;
assert_eq!(format!("{}", v), "w1 * w2 * 2");
assert_eq!(
format!("{}", [w1.clone(), w2.clone()].into_iter().product::<E>()),
"w1 * w2"
);
assert_eq!(
format!("{}", [f.clone(), f.clone()].into_iter().product::<E>()),
"2 * 2"
);
assert_eq!(format!("{}", [f, f].into_iter().product::<E>()), "2 * 2");
}
}

0 comments on commit 6304585

Please sign in to comment.