Remove a few unnecessary .into_iter() explicit calls, and some cloning.

See https://rust-lang.github.io/rust-clippy/master/#explicit_into_iter_loop
This commit is contained in:
François Garillot
2019-12-02 07:12:38 -08:00
committed by Pratyush Mishra
parent 581f3df55f
commit 10c6e85c1a
11 changed files with 17 additions and 17 deletions

View File

@@ -217,7 +217,7 @@ pub trait FieldGadget<F: Field, ConstraintF: Field>:
bits: &[Boolean],
) -> Result<Self, SynthesisError> {
let mut res = Self::one(cs.ns(|| "Alloc result"))?;
for (i, bit) in bits.into_iter().enumerate() {
for (i, bit) in bits.iter().enumerate() {
res = res.square(cs.ns(|| format!("Double {}", i)))?;
let tmp = res.mul(cs.ns(|| format!("Add {}-th base power", i)), self)?;
res = Self::conditionally_select(