Selaa lähdekoodia

refactor(clippy): clippy::manual_let_else

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Christina Sørensen 2 vuotta sitten
vanhempi
sitoutus
66b64d686c
1 muutettua tiedostoa jossa 1 lisäystä ja 4 poistoa
  1. 1 4
      src/options/filter.rs

+ 1 - 4
src/options/filter.rs

@@ -30,10 +30,7 @@ impl SortField {
     /// Returns the default sort field if none is given, or `Err` if the
     /// value doesn’t correspond to a sort field we know about.
     fn deduce(matches: &MatchedFlags<'_>) -> Result<Self, OptionsError> {
-        let word = match matches.get(&flags::SORT)? {
-            Some(w)  => w,
-            None     => return Ok(Self::default()),
-        };
+        let Some(word) = matches.get(&flags::SORT)? else { return Ok(Self::default()) };
 
         // Get String because we can’t match an OsStr
         let word = match word.to_str() {