clippy: Use `unwrap_or_default()`

Clippy was unhappy:

```text
error: use of `.unwrap_or_else(..)` to construct default value
   --> sdk/src/signer/keypair.rs:171:27
    |
171 |     let derivation_path = derivation_path.unwrap_or_else(DerivationPath::default);
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `derivation_path.unwrap_or_default()`
    |
    = note: `-D clippy::unwrap-or-else-default` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_else_default
```
This commit is contained in:
Brooks Prumo 2021-08-23 08:41:05 -05:00 committed by Brooks Prumo
parent c0c95e88d8
commit 96360f3139
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ pub fn keypair_from_seed_and_derivation_path(
seed: &[u8],
derivation_path: Option<DerivationPath>,
) -> Result<Keypair, Box<dyn error::Error>> {
let derivation_path = derivation_path.unwrap_or_else(DerivationPath::default);
let derivation_path = derivation_path.unwrap_or_default();
bip32_derived_keypair(seed, derivation_path).map_err(|err| err.to_string().into())
}