From 30ae7a8983235465d75b1a0250ab3b197dd136e5 Mon Sep 17 00:00:00 2001 From: Srinath Setty Date: Fri, 3 May 2024 17:12:09 -0700 Subject: [PATCH] address clippy --- src/provider/hyperkzg.rs | 6 ++++-- src/r1cs/mod.rs | 3 ++- src/spartan/direct.rs | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/provider/hyperkzg.rs b/src/provider/hyperkzg.rs index 6afc9a53..30d9d395 100644 --- a/src/provider/hyperkzg.rs +++ b/src/provider/hyperkzg.rs @@ -765,7 +765,8 @@ mod tests { // Change the proof and expect verification to fail let mut bad_proof = proof.clone(); - bad_proof.v[0] = bad_proof.v[1].clone(); + let v1 = bad_proof.v[1].clone(); + bad_proof.v[0].clone_from(&v1); let mut verifier_transcript2 = Keccak256Transcript::new(b"TestEval"); assert!(EvaluationEngine::verify( &vk, @@ -808,7 +809,8 @@ mod tests { // Change the proof and expect verification to fail let mut bad_proof = proof.clone(); - bad_proof.v[0] = bad_proof.v[1].clone(); + let v1 = bad_proof.v[1].clone(); + bad_proof.v[0].clone_from(&v1); let mut verifier_tr2 = Keccak256Transcript::new(b"TestEval"); assert!( EvaluationEngine::verify(&vk, &mut verifier_tr2, &C, &point, &eval, &bad_proof).is_err() diff --git a/src/r1cs/mod.rs b/src/r1cs/mod.rs index 56ef1394..b70b1876 100644 --- a/src/r1cs/mod.rs +++ b/src/r1cs/mod.rs @@ -480,7 +480,8 @@ impl RelaxedR1CSInstance { let mut r_instance = RelaxedR1CSInstance::default(ck, S); r_instance.comm_W = instance.comm_W; r_instance.u = E::Scalar::ONE; - r_instance.X = instance.X.clone(); + r_instance.X.clone_from(&instance.X); + r_instance } diff --git a/src/spartan/direct.rs b/src/spartan/direct.rs index 80986a2a..83cad2c3 100644 --- a/src/spartan/direct.rs +++ b/src/spartan/direct.rs @@ -277,7 +277,7 @@ mod tests { assert!(res.is_ok()); // set input to the next step - z_i = z_i_plus_one.clone(); + z_i.clone_from(&z_i_plus_one); } // sanity: check the claimed output with a direct computation of the same