Fix clippy warnings for Rust 1.53

This commit is contained in:
ariasuni 2021-05-12 00:32:12 +02:00
parent b18e93d283
commit 785d6ed991
3 changed files with 3 additions and 2 deletions

View File

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

View File

@ -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)]

View File

@ -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 {