Skip to content

Commit 0ad9f7d

Browse files
committed
Fix trivial cases of new match_wildcard_for_single_variants lint
1 parent 94e4b5e commit 0ad9f7d

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

clippy_lints/src/float_literal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FloatLiteral {
7777
let type_suffix = match lit_float_ty {
7878
LitFloatType::Suffixed(FloatTy::F32) => Some("f32"),
7979
LitFloatType::Suffixed(FloatTy::F64) => Some("f64"),
80-
_ => None
80+
LitFloatType::Unsuffixed => None
8181
};
8282
let (is_whole, mut float_str) = match fty {
8383
FloatTy::F32 => {

clippy_lints/src/misc_early.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ impl EarlyLintPass for MiscEarlyLints {
379379
let left_binding = match left {
380380
BindingMode::ByRef(Mutability::Mut) => "ref mut ",
381381
BindingMode::ByRef(Mutability::Not) => "ref ",
382-
_ => "",
382+
BindingMode::ByValue(..) => "",
383383
};
384384

385385
if let PatKind::Wild = right.kind {

clippy_lints/src/missing_const_for_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingConstForFn {
113113
return;
114114
}
115115
},
116-
_ => return,
116+
FnKind::Closure(..) => return,
117117
}
118118

119119
let mir = cx.tcx.optimized_mir(def_id);

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
8686
}
8787
},
8888
FnKind::Method(..) => (),
89-
_ => return,
89+
FnKind::Closure(..) => return,
9090
}
9191

9292
// Exclude non-inherent impls

clippy_lints/src/trivially_copy_pass_by_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TriviallyCopyPassByRef {
161161
}
162162
},
163163
FnKind::Method(..) => (),
164-
_ => return,
164+
FnKind::Closure(..) => return,
165165
}
166166

167167
// Exclude non-inherent impls

tests/compile-test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn third_party_crates() -> String {
4444
for entry in fs::read_dir(dep_dir).unwrap() {
4545
let path = match entry {
4646
Ok(entry) => entry.path(),
47-
_ => continue,
47+
Err(_) => continue,
4848
};
4949
if let Some(name) = path.file_name().and_then(OsStr::to_str) {
5050
for dep in CRATES {

0 commit comments

Comments
 (0)