Procházet zdrojové kódy

refactor(clippy): clippy::manual_let_else

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Christina Sørensen před 2 roky
rodič
revize
66b64d686c
1 změnil soubory, kde provedl 1 přidání a 4 odebrání
  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() {