Skip to content

Commit fc37f41

Browse files
committed
Use unwrap_or_default
Clippy emits: warning: use of `.unwrap_or_else(..)` to construct default value Use `unwrap_or_default` instead of `unwrap_or_else` with default value.
1 parent f0820ce commit fc37f41

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/descriptor/key.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,7 @@ impl FromStr for DescriptorPublicKey {
453453
Ok(DescriptorPublicKey::XPub(DescriptorXKey {
454454
origin,
455455
xkey: xpub,
456-
derivation_path: derivation_paths
457-
.into_iter()
458-
.next()
459-
.unwrap_or_else(bip32::DerivationPath::default),
456+
derivation_path: derivation_paths.into_iter().next().unwrap_or_default(),
460457
wildcard,
461458
}))
462459
}
@@ -716,10 +713,7 @@ impl FromStr for DescriptorSecretKey {
716713
Ok(DescriptorSecretKey::XPrv(DescriptorXKey {
717714
origin,
718715
xkey: xpriv,
719-
derivation_path: derivation_paths
720-
.into_iter()
721-
.next()
722-
.unwrap_or_else(bip32::DerivationPath::default),
716+
derivation_path: derivation_paths.into_iter().next().unwrap_or_default(),
723717
wildcard,
724718
}))
725719
}

0 commit comments

Comments
 (0)