Skip to content

Commit

Permalink
chores: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Feb 1, 2024
1 parent b2a1117 commit 7d70172
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
22 changes: 10 additions & 12 deletions snark-verifier/src/loader/halo2/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,11 @@ mod halo2_wrong {
)?;
let acc =
Value::known(*scalar) * lhs.value() * rhs.value() + Value::known(constant);
let output = values.iter().skip(1).fold(
Ok::<_, Error>(acc),
|acc, (scalar, lhs, rhs)| {
acc.and_then(|acc| {
let output =
values
.iter()
.skip(1)
.try_fold(acc, |acc, (scalar, lhs, rhs)| {
self.apply(
ctx,
[
Expand All @@ -292,10 +293,10 @@ mod halo2_wrong {
)
.into(),
)?;
Ok(acc + Value::known(*scalar) * lhs.value() * rhs.value())
})
},
)?;
Ok::<_, Error>(
acc + Value::known(*scalar) * lhs.value() * rhs.value(),
)
})?;
self.apply(
ctx,
[
Expand Down Expand Up @@ -419,10 +420,7 @@ mod halo2_wrong {
Ok::<_, Error>((scalar.deref().clone(), self.assign_constant(ctx, *base)?))
})
.collect::<Result<Vec<_>, _>>()?;
let pairs = pairs
.iter()
.map(|(scalar, base)| (scalar, base))
.collect_vec();
let pairs = pairs.iter().map(|tup| (&tup.0, &tup.1)).collect_vec();
self.variable_base_msm(ctx, &pairs)
}

Expand Down
2 changes: 1 addition & 1 deletion snark-verifier/src/pcs/kzg/accumulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ where
let (lhs, rhs) = instances
.iter()
.map(|accumulator| (&accumulator.lhs, &accumulator.rhs))
.chain(proof.blind.as_ref().map(|(lhs, rhs)| (lhs, rhs)))
.chain(proof.blind.as_ref().map(|tup| (&tup.0, &tup.1)))
.unzip::<_, _, Vec<_>, Vec<_>>();

let powers_of_r = proof.r.powers(lhs.len());
Expand Down

0 comments on commit 7d70172

Please sign in to comment.