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

Fix clippy warnings for Rust 1.53
This commit is contained in:
Mélanie Chauvel 2021-05-17 17:11:11 +02:00 committed by GitHub
commit 42b546606e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

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

View File

@ -18,6 +18,7 @@
#![allow(clippy::non_ascii_literal)] #![allow(clippy::non_ascii_literal)]
#![allow(clippy::option_if_let_else)] #![allow(clippy::option_if_let_else)]
#![allow(clippy::too_many_lines)] #![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::unused_self)]
#![allow(clippy::upper_case_acronyms)] #![allow(clippy::upper_case_acronyms)]
#![allow(clippy::wildcard_imports)] #![allow(clippy::wildcard_imports)]

View File

@ -432,7 +432,7 @@ impl<'a> MatchedFlags<'a> {
.filter(|tuple| tuple.1.is_some() && predicate(&tuple.0)) .filter(|tuple| tuple.1.is_some() && predicate(&tuple.0))
.collect::<Vec<_>>(); .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 { Err(OptionsError::Duplicate(those[0].0, those[1].0)) }
} }
else { else {