Use struct field init shorthand
Clippy emits: warning: redundant field names in struct initialization As suggested use struct field init shorthand.
This commit is contained in:
parent
641960f037
commit
fcd0f4deac
|
@ -621,7 +621,7 @@ impl Address {
|
||||||
network: Network
|
network: Network
|
||||||
) -> Address {
|
) -> Address {
|
||||||
Address {
|
Address {
|
||||||
network: network,
|
network,
|
||||||
payload: Payload::p2tr(secp, internal_key, merkle_root),
|
payload: Payload::p2tr(secp, internal_key, merkle_root),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,10 +217,10 @@ impl TaprootSpendInfo {
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let (output_key, parity) = internal_key.tap_tweak(secp, merkle_root);
|
let (output_key, parity) = internal_key.tap_tweak(secp, merkle_root);
|
||||||
Self {
|
Self {
|
||||||
internal_key: internal_key,
|
internal_key,
|
||||||
merkle_root: merkle_root,
|
merkle_root,
|
||||||
output_key_parity: parity,
|
output_key_parity: parity,
|
||||||
output_key: output_key,
|
output_key,
|
||||||
script_map: BTreeMap::new(),
|
script_map: BTreeMap::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -544,7 +544,7 @@ impl NodeInfo {
|
||||||
/// Creates a new [`NodeInfo`] with omitted/hidden info.
|
/// Creates a new [`NodeInfo`] with omitted/hidden info.
|
||||||
pub fn new_hidden_node(hash: sha256::Hash) -> Self {
|
pub fn new_hidden_node(hash: sha256::Hash) -> Self {
|
||||||
Self {
|
Self {
|
||||||
hash: hash,
|
hash,
|
||||||
leaves: vec![],
|
leaves: vec![],
|
||||||
has_hidden_nodes: true
|
has_hidden_nodes: true
|
||||||
}
|
}
|
||||||
|
@ -596,8 +596,8 @@ impl ScriptLeaf {
|
||||||
/// Creates an new [`ScriptLeaf`] from `script` and `ver` and no merkle branch.
|
/// Creates an new [`ScriptLeaf`] from `script` and `ver` and no merkle branch.
|
||||||
fn new(script: Script, ver: LeafVersion) -> Self {
|
fn new(script: Script, ver: LeafVersion) -> Self {
|
||||||
Self {
|
Self {
|
||||||
script: script,
|
script,
|
||||||
ver: ver,
|
ver,
|
||||||
merkle_branch: TaprootMerkleBranch(vec![]),
|
merkle_branch: TaprootMerkleBranch(vec![]),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue