Skip to content

Commit

Permalink
refactor: replace find_map with a find
Browse files Browse the repository at this point in the history
The argument is not transformed, so find is sufficient.
  • Loading branch information
sebastinas committed Aug 30, 2022
1 parent 28c80c8 commit 721b287
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/composed/message/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,10 @@ impl Message {
}

if encoding_key.is_none() {
encoding_subkey = key.secret_subkeys.iter().find_map(|subkey| {
if &subkey.key_id() == esk_packet.id() {
Some(subkey)
} else {
None
}
});
encoding_subkey = key
.secret_subkeys
.iter()
.find(|&subkey| &subkey.key_id() == esk_packet.id());
}

if encoding_key.is_some() || encoding_subkey.is_some() {
Expand Down

0 comments on commit 721b287

Please sign in to comment.