From 8ef2a850418c25e7290cf6267a9f4433d9bc59da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Wed, 28 Feb 2024 15:53:23 -0500 Subject: [PATCH] chore: minor cleanups --- src/gadgets/nonnative/util.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gadgets/nonnative/util.rs b/src/gadgets/nonnative/util.rs index 22ed4f4a3..3a4f30aa8 100644 --- a/src/gadgets/nonnative/util.rs +++ b/src/gadgets/nonnative/util.rs @@ -158,9 +158,9 @@ 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 +202,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 {