summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2022-11-14 14:50:30 +0100
committerNora Widdecke <nora@sequoia-pgp.org>2022-11-14 15:42:48 +0100
commit091b10bf8dc10c099317ba9d0ed6f6aae7b16a1b (patch)
tree4efba4b8f4b4cbe7649c6b214db52d067286d406
parent31e5f3473795b96b45eeac38b761fd11e55ddcb5 (diff)
lint: clippy::manual_find
https://rust-lang.github.io/rust-clippy/master/index.html#manual_find
-rw-r--r--autocrypt/src/lib.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/autocrypt/src/lib.rs b/autocrypt/src/lib.rs
index 932c0623..576811a5 100644
--- a/autocrypt/src/lib.rs
+++ b/autocrypt/src/lib.rs
@@ -182,13 +182,7 @@ impl AutocryptHeader {
/// Looks up an attribute.
pub fn get(&self, key: &str) -> Option<&Attribute> {
- for a in &self.attributes {
- if a.key == key {
- return Some(a);
- }
- }
-
- None
+ self.attributes.iter().find(|&a| a.key == key)
}
/// Writes a serialized version of the object to `o`.