Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add note about update-all-refs script, revert redundant pat to master
  • Loading branch information
DevinR528 committed Apr 20, 2020
commit fca3537fa3e88d80936222177b96ae0b918c022e
12 changes: 4 additions & 8 deletions clippy_lints/src/if_let_mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
4 changes: 3 additions & 1 deletion doc/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/ui/redundant_pattern_matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down