Fix trivial cases of new match_wildcard_for_single_variants lint
This commit is contained in:
parent
94e4b5ec31
commit
0ad9f7d651
@ -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 => {
|
||||
|
@ -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 {
|
||||
|
@ -113,7 +113,7 @@ fn check_fn(
|
||||
return;
|
||||
}
|
||||
},
|
||||
_ => return,
|
||||
FnKind::Closure(..) => return,
|
||||
}
|
||||
|
||||
let mir = cx.tcx.optimized_mir(def_id);
|
||||
|
@ -86,7 +86,7 @@ fn check_fn(
|
||||
}
|
||||
},
|
||||
FnKind::Method(..) => (),
|
||||
_ => return,
|
||||
FnKind::Closure(..) => return,
|
||||
}
|
||||
|
||||
// Exclude non-inherent impls
|
||||
|
@ -161,7 +161,7 @@ fn check_fn(
|
||||
}
|
||||
},
|
||||
FnKind::Method(..) => (),
|
||||
_ => return,
|
||||
FnKind::Closure(..) => return,
|
||||
}
|
||||
|
||||
// Exclude non-inherent impls
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user