فهرست منبع

Merge pull request #871 from ariasuni/fix-clippy-warnings-for-rust-1.53

Fix clippy warnings for Rust 1.53
Mélanie Chauvel 4 سال پیش
والد
کامیت
42b546606e
3فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 1 1
      src/fs/dir_action.rs
  2. 1 0
      src/main.rs
  3. 1 1
      src/options/parser.rs

+ 1 - 1
src/fs/dir_action.rs

@@ -51,7 +51,7 @@ impl DirAction {
         match self {
             Self::AsFile      => true,
             Self::Recurse(o)  => o.tree,
-            _                 => false,
+            Self::List        => false,
         }
     }
 }

+ 1 - 0
src/main.rs

@@ -18,6 +18,7 @@
 #![allow(clippy::non_ascii_literal)]
 #![allow(clippy::option_if_let_else)]
 #![allow(clippy::too_many_lines)]
+#![allow(clippy::unnested_or_patterns)] // TODO: remove this when we support Rust 1.53.0
 #![allow(clippy::unused_self)]
 #![allow(clippy::upper_case_acronyms)]
 #![allow(clippy::wildcard_imports)]

+ 1 - 1
src/options/parser.rs

@@ -432,7 +432,7 @@ impl<'a> MatchedFlags<'a> {
                             .filter(|tuple| tuple.1.is_some() && predicate(&tuple.0))
                             .collect::<Vec<_>>();
 
-            if those.len() < 2 { Ok(those.first().cloned().map(|t| t.1.unwrap())) }
+            if those.len() < 2 { Ok(those.first().copied().map(|t| t.1.unwrap())) }
                           else { Err(OptionsError::Duplicate(those[0].0, those[1].0)) }
         }
         else {