diff --git a/clippy_lints/src/if_let_mutex.rs b/clippy_lints/src/if_let_mutex.rs index cc1de314d01..3998360e4bf 100644 --- a/clippy_lints/src/if_let_mutex.rs +++ b/clippy_lints/src/if_let_mutex.rs @@ -64,14 +64,10 @@ impl LateLintPass<'_, '_> for IfLetMutex { } fn matching_arm(arm: &Arm<'_>, op: &Expr<'_>, ex: &Expr<'_>, cx: &LateContext<'_, '_>) -> bool { - if_chain! { - if let ExprKind::Block(ref block, _l) = arm.body.kind; - if block.stmts.iter().any(|stmt| matching_stmt(stmt, op, ex, cx)); - then { - true - } else { - false - } + if let ExprKind::Block(ref block, _l) = arm.body.kind { + block.stmts.iter().any(|stmt| matching_stmt(stmt, op, ex, cx)) + } else { + false } } diff --git a/doc/adding_lints.md b/doc/adding_lints.md index 94d6ccb316e..b7520ae74e2 100644 --- a/doc/adding_lints.md +++ b/doc/adding_lints.md @@ -101,7 +101,9 @@ Once we are satisfied with the output, we need to run Please note that, we should run `TESTNAME=foo_functions cargo uitest` every time before running `tests/ui/update-all-references.sh`. Running `TESTNAME=foo_functions cargo uitest` should pass then. When we commit -our lint, we need to commit the generated `.stderr` files, too. +our lint, we need to commit the generated `.stderr` files, too. In general you +should only run `tests/ui/update-all-references.sh` for the specific lint you are +creating/editing. ## Rustfix tests diff --git a/tests/ui/redundant_pattern_matching.rs b/tests/ui/redundant_pattern_matching.rs index 651eb949a5b..9a9b3fb5ca0 100644 --- a/tests/ui/redundant_pattern_matching.rs +++ b/tests/ui/redundant_pattern_matching.rs @@ -85,7 +85,6 @@ fn main() { let _ = does_something(); let _ = returns_unit(); - let _ = issue_5271(); let opt = Some(false); let x = if let Some(_) = opt { true } else { false };