From cdfd2ab0f9267db5c58976348ee984e091496763 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 28 May 2021 12:06:50 +0100 Subject: [PATCH] Remove clones from types that now impl Copy --- src/builder.rs | 9 ++------- src/bundle.rs | 2 +- src/circuit.rs | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 0b106705..6ed10616 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -135,12 +135,7 @@ impl ActionInfo { let alpha = pallas::Scalar::random(&mut rng); let rk = ak.randomize(&alpha); - let note = Note::new( - self.output.recipient, - self.output.value, - nf_old.clone(), - rng, - ); + let note = Note::new(self.output.recipient, self.output.value, nf_old, rng); let cm_new = note.commitment(); // TODO: Note encryption @@ -542,7 +537,7 @@ pub mod testing { recipient_amounts in vec( arb_address().prop_flat_map(move |a| { arb_positive_note_value(MAX_NOTE_VALUE / n_recipients as u64) - .prop_map(move |v| (a.clone(), v)) + .prop_map(move |v| (a, v)) }), n_recipients as usize ), diff --git a/src/bundle.rs b/src/bundle.rs index 2b9de127..ac41e2fb 100644 --- a/src/bundle.rs +++ b/src/bundle.rs @@ -112,7 +112,7 @@ impl Action { Instance { anchor, cv_net: self.cv_net.clone(), - nf_old: self.nf.clone(), + nf_old: self.nf, rk: self.rk.clone(), cmx: self.cmx.clone(), enable_spend: flags.spends_enabled, diff --git a/src/circuit.rs b/src/circuit.rs index 16995821..3fbb2760 100644 --- a/src/circuit.rs +++ b/src/circuit.rs @@ -197,7 +197,7 @@ mod tests { let alpha = pallas::Scalar::random(&mut rng); let rk = ak.randomize(&alpha); - let (_, _, output_note) = Note::dummy(&mut rng, Some(nf_old.clone())); + let (_, _, output_note) = Note::dummy(&mut rng, Some(nf_old)); let cmx = output_note.commitment().into(); let value = spent_note.value() - output_note.value();