Use default pattern
Clippy emits warning: warning: field assignment outside of initializer for an instance created with Default::default() Do as suggested by clippy and use the default init pattern. ``` let foo = Foo { bar: ..., Default::default() } ```
This commit is contained in:
parent
824b00c9e0
commit
35184e6908
@ -3220,15 +3220,18 @@ mod test {
|
|||||||
let (mut psbt, _) = builder.finish().unwrap();
|
let (mut psbt, _) = builder.finish().unwrap();
|
||||||
|
|
||||||
// add another input to the psbt that is at least passable.
|
// add another input to the psbt that is at least passable.
|
||||||
let mut dud_input = bitcoin::util::psbt::Input::default();
|
let dud_input = bitcoin::util::psbt::Input {
|
||||||
dud_input.witness_utxo = Some(TxOut {
|
witness_utxo: Some(TxOut {
|
||||||
value: 100_000,
|
value: 100_000,
|
||||||
script_pubkey: miniscript::Descriptor::<bitcoin::PublicKey>::from_str(
|
script_pubkey: miniscript::Descriptor::<bitcoin::PublicKey>::from_str(
|
||||||
"wpkh(025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee6357)",
|
"wpkh(025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee6357)",
|
||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.script_pubkey(),
|
.script_pubkey(),
|
||||||
});
|
}),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
psbt.inputs.push(dud_input);
|
psbt.inputs.push(dud_input);
|
||||||
psbt.global.unsigned_tx.input.push(bitcoin::TxIn::default());
|
psbt.global.unsigned_tx.input.push(bitcoin::TxIn::default());
|
||||||
let (psbt, is_final) = wallet.sign(psbt, None).unwrap();
|
let (psbt, is_final) = wallet.sign(psbt, None).unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user