Clippy formatting (#131)

* Clippy with Rust 1.67

* Clippy/Rustfmt with Rust 1.66.1
This commit is contained in:
Samuel Burnham
2023-01-31 17:53:15 -05:00
committed by GitHub
parent 74501936c3
commit b2adab610a
14 changed files with 60 additions and 71 deletions

View File

@@ -97,7 +97,7 @@ where
for i in 0..self.seq.len() {
// non deterministic advice
let x_i_plus_1 =
AllocatedNum::alloc(cs.namespace(|| format!("x_i_plus_1_iter_{}", i)), || {
AllocatedNum::alloc(cs.namespace(|| format!("x_i_plus_1_iter_{i}")), || {
Ok(self.seq[i].x_i_plus_1)
})?;
@@ -106,12 +106,11 @@ where
// (ii) y_i_plus_1 = x_i
// (1) constraints for condition (i) are below
// (2) constraints for condition (ii) is avoided because we just used x_i wherever y_i_plus_1 is used
let x_i_plus_1_sq =
x_i_plus_1.square(cs.namespace(|| format!("x_i_plus_1_sq_iter_{}", i)))?;
let x_i_plus_1_sq = x_i_plus_1.square(cs.namespace(|| format!("x_i_plus_1_sq_iter_{i}")))?;
let x_i_plus_1_quad =
x_i_plus_1_sq.square(cs.namespace(|| format!("x_i_plus_1_quad_{}", i)))?;
x_i_plus_1_sq.square(cs.namespace(|| format!("x_i_plus_1_quad_{i}")))?;
cs.enforce(
|| format!("x_i_plus_1_quad * x_i_plus_1 = x_i + y_i_iter_{}", i),
|| format!("x_i_plus_1_quad * x_i_plus_1 = x_i + y_i_iter_{i}"),
|lc| lc + x_i_plus_1_quad.get_variable(),
|lc| lc + x_i_plus_1.get_variable(),
|lc| lc + x_i.get_variable() + y_i.get_variable(),
@@ -163,10 +162,7 @@ fn main() {
let circuit_secondary = TrivialTestCircuit::default();
println!(
"Proving {} iterations of MinRoot per step",
num_iters_per_step
);
println!("Proving {num_iters_per_step} iterations of MinRoot per step");
// produce public parameters
let start = Instant::now();

View File

@@ -185,7 +185,7 @@ pub fn synthesize_bits<F: PrimeField, CS: ConstraintSystem<F>>(
.into_iter()
.map(|i| {
AllocatedBit::alloc(
cs.namespace(|| format!("bit {}", i)),
cs.namespace(|| format!("bit {i}")),
Some(bits.as_ref().unwrap()[i as usize]),
)
})