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
creating suggestion
  • Loading branch information
DevinR528 committed Apr 20, 2020
commit 139e2c6227506d7dc0be8ddff3cfd1fbe818a1a4
2 changes: 1 addition & 1 deletion clippy_lints/src/if_let_mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ declare_clippy_lint! {
/// ```
pub IF_LET_MUTEX,
correctness,
"locking a `Mutex` in an `if let` block can cause deadlock"
"locking a `Mutex` in an `if let` block can cause deadlocks"
}

declare_lint_pass!(IfLetMutex => [IF_LET_MUTEX]);
Expand Down
Binary file added if_let_mutex
Binary file not shown.
Binary file added redundant_pattern_matching
Binary file not shown.
8 changes: 8 additions & 0 deletions tests/ui/redundant_pattern_matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ 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 Expand Up @@ -112,3 +113,10 @@ fn returns_unit() {
false
};
}

fn issue_5271() {
let hello = Some(String::from("hello"));
let _x = match hello {
s @ _ => drop(s),
};
}