Skip to content

Commit

Permalink
Fix trivial cases of new match_wildcard_for_single_variants lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vtmargaryan committed May 14, 2020
1 parent 94e4b5e commit 0ad9f7d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/float_literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FloatLiteral {
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 => {
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/misc_early.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl EarlyLintPass for MiscEarlyLints {
let left_binding = match left {
BindingMode::ByRef(Mutability::Mut) => "ref mut ",
BindingMode::ByRef(Mutability::Not) => "ref ",
_ => "",
BindingMode::ByValue(..) => "",
};

if let PatKind::Wild = right.kind {
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/missing_const_for_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingConstForFn {
return;
}
},
_ => return,
FnKind::Closure(..) => return,
}

let mir = cx.tcx.optimized_mir(def_id);
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/needless_pass_by_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
}
},
FnKind::Method(..) => (),
_ => return,
FnKind::Closure(..) => return,
}

// Exclude non-inherent impls
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/trivially_copy_pass_by_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TriviallyCopyPassByRef {
}
},
FnKind::Method(..) => (),
_ => return,
FnKind::Closure(..) => return,
}

// Exclude non-inherent impls
Expand Down
2 changes: 1 addition & 1 deletion tests/compile-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0ad9f7d

Please sign in to comment.