diff --git a/src/gadgets/nonnative/util.rs b/src/gadgets/nonnative/util.rs index 22ed4f4a3..542ffa35c 100644 --- a/src/gadgets/nonnative/util.rs +++ b/src/gadgets/nonnative/util.rs @@ -158,9 +158,8 @@ impl Num { /// Computes the natural number represented by an array of bits. /// Checks if the natural number equals `self` pub fn is_equal>(&self, mut cs: CS, other: &Bitvector) { - let allocations = other.allocations.clone(); let mut f = Scalar::ONE; - let sum = allocations + let sum = other.allocations .iter() .fold(LinearCombination::zero(), |lc, bit| { let l = lc + (f, &bit.bit); @@ -202,8 +201,7 @@ impl Num { let sum_lc = LinearCombination::zero() + &self.num - ∑ cs.enforce(|| "sum", |lc| lc + &sum_lc, |lc| lc + CS::one(), |lc| lc); let bits: Vec> = allocations - .clone() - .into_iter() + .iter() .map(|a| LinearCombination::zero() + &a.bit) .collect(); Ok(Bitvector {