Skip to content

Commit

Permalink
chore: remove unnecessary closure
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Jun 4, 2024
1 parent 9d82ff9 commit 6bb4552
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/keystore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Keystore {

let peer_id_str = peer_id.as_str();

let name = name.unwrap_or_else(|| peer_id_str);
let name = name.unwrap_or(peer_id_str);

let bytes = Key::from(keypair.to_protobuf_encoding()?);

Expand Down Expand Up @@ -134,7 +134,7 @@ impl Keystore {
// We could probably wrap this in `Zeroizing` instead until `KeyStore` is refactored to accept `Key`
let bytes = Key::from(keypair.to_protobuf_encoding()?);

let name = name.unwrap_or_else(|| peer_id_str);
let name = name.unwrap_or(peer_id_str);

self.storage.set(name, bytes.as_ref()).await?;

Expand Down

0 comments on commit 6bb4552

Please sign in to comment.