From f1aba8115bc56b9ff9a17dc697022e8338492516 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sat, 7 Dec 2019 02:24:42 +0300 Subject: [PATCH] Use Option.unwrap_or_default in aheader.rs --- src/aheader.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/aheader.rs b/src/aheader.rs index 0c6e8e607..62437ce74 100644 --- a/src/aheader.rs +++ b/src/aheader.rs @@ -150,13 +150,10 @@ impl str::FromStr for Aheader { } }; - let prefer_encrypt = match attributes + let prefer_encrypt = attributes .remove("prefer-encrypt") .and_then(|raw| raw.parse().ok()) - { - Some(pref) => pref, - None => EncryptPreference::NoPreference, - }; + .unwrap_or_default(); // Autocrypt-Level0: unknown attributes starting with an underscore can be safely ignored // Autocrypt-Level0: unknown attribute, treat the header as invalid