Skip to content

Commit d99b256

Browse files
committed
Remove explicit borrow
clippy emits: error: the borrowed expression implements the required traits As suggested remove the explicit borrow.
1 parent 7965e72 commit d99b256

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

bitcoin/examples/ecdsa-psbt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl WatchOnly {
232232

233233
let sigs: Vec<_> = psbt.inputs[0].partial_sigs.values().collect();
234234
let mut script_witness: Witness = Witness::new();
235-
script_witness.push(&sigs[0].to_vec());
235+
script_witness.push(sigs[0].to_vec());
236236
script_witness.push(self.input_xpub.to_pub().to_bytes());
237237

238238
psbt.inputs[0].final_script_witness = Some(script_witness);

bitcoin/tests/bip_174.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ fn finalize_psbt(mut psbt: Psbt) -> Psbt {
453453
let sigs: Vec<_> = psbt.inputs[1].partial_sigs.values().collect();
454454
let mut script_witness = Witness::new();
455455
script_witness.push([]); // Push 0x00 to the stack.
456-
script_witness.push(&sigs[1].to_vec());
457-
script_witness.push(&sigs[0].to_vec());
456+
script_witness.push(sigs[1].to_vec());
457+
script_witness.push(sigs[0].to_vec());
458458
script_witness.push(psbt.inputs[1].witness_script.clone().unwrap().as_bytes());
459459

460460
script_witness

bitcoin/tests/psbt-sign-taproot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn psbt_sign_taproot() {
6262
let script3 = create_basic_single_sig_script(secp, sk_path[2].0); // m/86'/1'/0'/0/2
6363

6464
// Just use one of the secret keys for the key path spend.
65-
let kp = Keypair::from_seckey_str(secp, &sk_path[2].0).expect("failed to create keypair");
65+
let kp = Keypair::from_seckey_str(secp, sk_path[2].0).expect("failed to create keypair");
6666

6767
let internal_key = kp.x_only_public_key().0; // Ignore the parity.
6868

@@ -119,7 +119,7 @@ fn psbt_sign_taproot() {
119119
// script path spend
120120
{
121121
// use private key of path "m/86'/1'/0'/0/1" as signing key
122-
let kp = Keypair::from_seckey_str(secp, &sk_path[1].0).expect("failed to create keypair");
122+
let kp = Keypair::from_seckey_str(secp, sk_path[1].0).expect("failed to create keypair");
123123
let x_only_pubkey = kp.x_only_public_key().0;
124124
let signing_key_path = sk_path[1].1;
125125

0 commit comments

Comments
 (0)