Skip to content

Commit

Permalink
Remove unnecessary call to clone
Browse files Browse the repository at this point in the history
Clippy emits:

warning: using `clone` on type `secp256k1::XOnlyPublicKey` which
implements the `Copy` trait

As suggested, remove call to `clone`.
  • Loading branch information
tcharding committed May 25, 2022
1 parent 27649ba commit f81d4aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/schnorr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl TapTweak for UntweakedPublicKey {
/// The tweaked key and its parity.
fn tap_tweak<C: Verification>(self, secp: &Secp256k1<C>, merkle_root: Option<TapBranchHash>) -> (TweakedPublicKey, secp256k1::Parity) {
let tweak_value = TapTweakHash::from_key_and_tweak(self, merkle_root).into_inner();
let mut output_key = self.clone();
let mut output_key = self;
let parity = output_key.tweak_add_assign(secp, &tweak_value).expect("Tap tweak failed");

debug_assert!(self.tweak_add_check(secp, &output_key, parity, tweak_value));
Expand Down

0 comments on commit f81d4aa

Please sign in to comment.