diff --git a/crypto-primitives/src/nizk/gm17/constraints.rs b/crypto-primitives/src/nizk/gm17/constraints.rs index fbcc1ff..1bf8cbd 100644 --- a/crypto-primitives/src/nizk/gm17/constraints.rs +++ b/crypto-primitives/src/nizk/gm17/constraints.rs @@ -180,7 +180,7 @@ where P::miller_loop( cs.ns(|| "Miller loop 4"), &[a_prep, pvk.g_gamma_pc.clone()], - &[pvk.h_gamma_pc.clone(), b_prep], + &[pvk.h_gamma_pc, b_prep], )? }; let test2 = P::final_exponentiation(cs.ns(|| "Final Exp 2"), &test2_exp)?; diff --git a/r1cs-std/src/fields/fp2.rs b/r1cs-std/src/fields/fp2.rs index 1d7f670..618f566 100644 --- a/r1cs-std/src/fields/fp2.rs +++ b/r1cs-std/src/fields/fp2.rs @@ -76,8 +76,8 @@ impl, ConstraintF: PrimeField> FieldGadget Self::Variable { ( - self.c0.get_variable().clone(), - self.c1.get_variable().clone(), + self.c0.get_variable(), + self.c1.get_variable(), ) } diff --git a/r1cs-std/src/pairing/bls12/mod.rs b/r1cs-std/src/pairing/bls12/mod.rs index bbe52c3..421e2c2 100644 --- a/r1cs-std/src/pairing/bls12/mod.rs +++ b/r1cs-std/src/pairing/bls12/mod.rs @@ -39,7 +39,7 @@ impl PairingGadget

{ TwistType::M => { let c0 = coeffs.0.clone(); let mut c1 = coeffs.1.clone(); - let c2 = Fp2G::

::new(p.y.clone(), zero.clone()); + let c2 = Fp2G::

::new(p.y.clone(), zero); c1.c0 = c1.c0.mul(cs.ns(|| "mul c1.c0"), &p.x)?; c1.c1 = c1.c1.mul(cs.ns(|| "mul c1.c1"), &p.x)?; @@ -47,7 +47,7 @@ impl PairingGadget

{ Ok(()) }, TwistType::D => { - let c0 = Fp2G::

::new(p.y.clone(), zero.clone()); + let c0 = Fp2G::

::new(p.y.clone(), zero); let mut c1 = coeffs.0.clone(); let c2 = coeffs.1.clone(); diff --git a/r1cs-std/src/pairing/mod.rs b/r1cs-std/src/pairing/mod.rs index 42db4ff..e1ad84c 100644 --- a/r1cs-std/src/pairing/mod.rs +++ b/r1cs-std/src/pairing/mod.rs @@ -108,7 +108,7 @@ mod test { let (ans1_g, ans1_n) = { let ans_g = PairingGadget::pairing( cs.ns(|| "pair(sa, b)"), - sa_prep_g.clone(), + sa_prep_g, b_prep_g.clone(), ) .unwrap(); @@ -120,7 +120,7 @@ mod test { let ans_g = PairingGadget::pairing( cs.ns(|| "pair(a, sb)"), a_prep_g.clone(), - sb_prep_g.clone(), + sb_prep_g, ) .unwrap(); let ans_n = Bls12_377::pairing(a, sb); @@ -129,11 +129,11 @@ mod test { let (ans3_g, ans3_n) = { let s_iter = BitIterator::new(s.into_repr()) - .map(|bit| Boolean::constant(bit)) + .map(Boolean::constant) .collect::>(); let mut ans_g = - PairingGadget::pairing(cs.ns(|| "pair(a, b)"), a_prep_g.clone(), b_prep_g.clone()) + PairingGadget::pairing(cs.ns(|| "pair(a, b)"), a_prep_g, b_prep_g) .unwrap(); let mut ans_n = Bls12_377::pairing(a, b); ans_n = ans_n.pow(s.into_repr()); diff --git a/r1cs-std/src/test_constraint_system.rs b/r1cs-std/src/test_constraint_system.rs index 8096c4b..f1a98c2 100644 --- a/r1cs-std/src/test_constraint_system.rs +++ b/r1cs-std/src/test_constraint_system.rs @@ -212,7 +212,7 @@ impl ConstraintSystem for TestConstraintSystem< { let name = name_fn().into(); let path = compute_path(&self.current_namespace, name.clone()); - self.set_named_obj(path.clone(), NamedObject::Namespace); + self.set_named_obj(path, NamedObject::Namespace); self.current_namespace.push(name); }