Skip to content

Commit 27278a5

Browse files
committed
Use ..Default::default() to initialize TxIn
Clippy emits: field assignment outside of initializer for an instance created with Default::default() As suggested, use `..Default` to initialize the `TxIn`. While we are at it remove unnecessary comment (looks like it originated as commented out code).
1 parent 5d5112f commit 27278a5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/psbt_sign_finalize.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ fn main() {
8080

8181
let (outpoint, witness_utxo) = get_vout(&depo_tx, &bridge_descriptor.script_pubkey());
8282

83-
let mut txin = TxIn::default();
84-
txin.previous_output = outpoint;
85-
86-
txin.sequence = Sequence::from_height(26); //Sequence::MAX; //
83+
let txin = TxIn {
84+
previous_output: outpoint,
85+
sequence: Sequence::from_height(26),
86+
..Default::default()
87+
};
8788
psbt.unsigned_tx.input.push(txin);
8889

8990
psbt.unsigned_tx

0 commit comments

Comments
 (0)