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:
Tobin Harding 2020-12-23 14:16:43 +11:00
parent 824b00c9e0
commit 35184e6908
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607

View File

@ -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();