Skip to content

Commit c11d117

Browse files
committed
fix clippy
1 parent a009e5d commit c11d117

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

crates/provers/stark/src/constraints/transition.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use itertools::Itertools;
77
use lambdaworks_math::field::element::FieldElement;
88
use lambdaworks_math::field::traits::{IsFFTField, IsField, IsSubFieldOf};
99
use lambdaworks_math::polynomial::Polynomial;
10-
use num_integer::Integer;
10+
1111
/// TransitionConstraint represents the behaviour that a transition constraint
1212
/// over the computation that wants to be proven must comply with.
1313
pub trait TransitionConstraint<F, E>: Send + Sync
@@ -121,7 +121,7 @@ where
121121
// FIXME: Rather than making this assertions here, it would be better to handle these
122122
// errors or make these checks when the AIR is initialized.
123123

124-
debug_assert!(exemptions_period.is_multiple_of(&self.period()));
124+
debug_assert!(exemptions_period.is_multiple_of(self.period()));
125125

126126
debug_assert!(self.periodic_exemptions_offset().is_some());
127127

@@ -219,7 +219,7 @@ where
219219
let end_exemptions_poly = self.end_exemptions_poly(trace_primitive_root, trace_length);
220220

221221
if let Some(exemptions_period) = self.exemptions_period() {
222-
debug_assert!(exemptions_period.is_multiple_of(&self.period()));
222+
debug_assert!(exemptions_period.is_multiple_of(self.period()));
223223

224224
debug_assert!(self.periodic_exemptions_offset().is_some());
225225

examples/merkle-tree-cli/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type FE = FieldElement<Stark252PrimeField>;
1818

1919
fn load_fe_from_file(file_path: &String) -> Result<FE, io::Error> {
2020
FE::from_hex(&fs::read_to_string(file_path)?.replace('\n', ""))
21-
.map_err(|e| io::Error::new(io::ErrorKind::Other, format!("{:?}", e)))
21+
.map_err(|e| io::Error::other(format!("{:?}", e)))
2222
}
2323

2424
fn load_tree_values(tree_path: &String) -> Result<Vec<FE>, io::Error> {
@@ -32,7 +32,7 @@ fn generate_merkle_tree(tree_path: String) -> Result<(), io::Error> {
3232
let values: Vec<FE> = load_tree_values(&tree_path)?;
3333

3434
let merkle_tree = MerkleTree::<TreePoseidon<PoseidonCairoStark252>>::build(&values)
35-
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "requested empty tree"))?;
35+
.ok_or_else(|| io::Error::other("requested empty tree"))?;
3636
let root = merkle_tree.root.representative().to_string();
3737
println!("Generated merkle tree with root: {:?}", root);
3838

@@ -53,10 +53,10 @@ fn generate_merkle_tree(tree_path: String) -> Result<(), io::Error> {
5353
fn generate_merkle_proof(tree_path: String, pos: usize) -> Result<(), io::Error> {
5454
let values: Vec<FE> = load_tree_values(&tree_path)?;
5555
let merkle_tree = MerkleTree::<TreePoseidon<PoseidonCairoStark252>>::build(&values)
56-
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "requested empty tree"))?;
56+
.ok_or_else(|| io::Error::other("requested empty tree"))?;
5757

5858
let Some(proof) = merkle_tree.get_proof_by_pos(pos) else {
59-
return Err(io::Error::new(io::ErrorKind::Other, "Index out of bounds"));
59+
return Err(io::Error::other("Index out of bounds"));
6060
};
6161

6262
let proof_path = tree_path.replace(".csv", format!("_proof_{pos}.json").as_str());
@@ -67,7 +67,7 @@ fn generate_merkle_proof(tree_path: String, pos: usize) -> Result<(), io::Error>
6767

6868
let leaf_value = values
6969
.get(pos)
70-
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "Invalid position"))?
70+
.ok_or_else(|| io::Error::other("Invalid position"))?
7171
.representative()
7272
.to_string();
7373

0 commit comments

Comments
 (0)