Fix trivial cases of new match_wildcard_for_single_variants lint

This commit is contained in:
Vardan Margaryan 2020-05-10 18:33:12 +03:00
parent 94e4b5ec31
commit 0ad9f7d651
6 changed files with 6 additions and 6 deletions

View File

@ -77,7 +77,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr<'_>)
let type_suffix = match lit_float_ty {
LitFloatType::Suffixed(FloatTy::F32) => Some("f32"),
LitFloatType::Suffixed(FloatTy::F64) => Some("f64"),
_ => None
LitFloatType::Unsuffixed => None
};
let (is_whole, mut float_str) = match fty {
FloatTy::F32 => {

View File

@ -379,7 +379,7 @@ fn check_pat(&mut self, cx: &EarlyContext<'_>, pat: &Pat) {
let left_binding = match left {
BindingMode::ByRef(Mutability::Mut) => "ref mut ",
BindingMode::ByRef(Mutability::Not) => "ref ",
_ => "",
BindingMode::ByValue(..) => "",
};
if let PatKind::Wild = right.kind {

View File

@ -113,7 +113,7 @@ fn check_fn(
return;
}
},
_ => return,
FnKind::Closure(..) => return,
}
let mir = cx.tcx.optimized_mir(def_id);

View File

@ -86,7 +86,7 @@ fn check_fn(
}
},
FnKind::Method(..) => (),
_ => return,
FnKind::Closure(..) => return,
}
// Exclude non-inherent impls

View File

@ -161,7 +161,7 @@ fn check_fn(
}
},
FnKind::Method(..) => (),
_ => return,
FnKind::Closure(..) => return,
}
// Exclude non-inherent impls

View File

@ -44,7 +44,7 @@ fn third_party_crates() -> String {
for entry in fs::read_dir(dep_dir).unwrap() {
let path = match entry {
Ok(entry) => entry.path(),
_ => continue,
Err(_) => continue,
};
if let Some(name) = path.file_name().and_then(OsStr::to_str) {
for dep in CRATES {