Skip to content

Commit

Permalink
Use struct field init shorthand
Browse files Browse the repository at this point in the history
Clippy emits:

  warning: redundant field names in struct initialization

As suggested use struct field init shorthand.
  • Loading branch information
tcharding committed May 25, 2022
1 parent 641960f commit fcd0f4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/util/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ impl Address {
network: Network
) -> Address {
Address {
network: network,
network,
payload: Payload::p2tr(secp, internal_key, merkle_root),
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/util/taproot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ impl TaprootSpendInfo {
) -> Self {
let (output_key, parity) = internal_key.tap_tweak(secp, merkle_root);
Self {
internal_key: internal_key,
merkle_root: merkle_root,
internal_key,
merkle_root,
output_key_parity: parity,
output_key: output_key,
output_key,
script_map: BTreeMap::new(),
}
}
Expand Down Expand Up @@ -544,7 +544,7 @@ impl NodeInfo {
/// Creates a new [`NodeInfo`] with omitted/hidden info.
pub fn new_hidden_node(hash: sha256::Hash) -> Self {
Self {
hash: hash,
hash,
leaves: vec![],
has_hidden_nodes: true
}
Expand Down Expand Up @@ -596,8 +596,8 @@ impl ScriptLeaf {
/// Creates an new [`ScriptLeaf`] from `script` and `ver` and no merkle branch.
fn new(script: Script, ver: LeafVersion) -> Self {
Self {
script: script,
ver: ver,
script,
ver,
merkle_branch: TaprootMerkleBranch(vec![]),
}
}
Expand Down

0 comments on commit fcd0f4d

Please sign in to comment.