Skip to content

Commit bba34f7

Browse files
committed
creating suggestion
1 parent 5ec4937 commit bba34f7

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

clippy_lints/src/if_let_mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ declare_clippy_lint! {
3030
/// ```
3131
pub IF_LET_MUTEX,
3232
correctness,
33-
"locking a `Mutex` in an `if let` block can cause deadlock"
33+
"locking a `Mutex` in an `if let` block can cause deadlocks"
3434
}
3535

3636
declare_lint_pass!(IfLetMutex => [IF_LET_MUTEX]);

if_let_mutex

2.64 MB
Binary file not shown.

redundant_pattern_matching

2.68 MB
Binary file not shown.

tests/ui/redundant_pattern_matching.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ fn main() {
8585

8686
let _ = does_something();
8787
let _ = returns_unit();
88+
let _ = issue_5271();
8889

8990
let opt = Some(false);
9091
let x = if let Some(_) = opt { true } else { false };
@@ -112,3 +113,10 @@ fn returns_unit() {
112113
false
113114
};
114115
}
116+
117+
fn issue_5271() {
118+
let hello = Some(String::from("hello"));
119+
let _x = match hello {
120+
s @ _ => drop(s),
121+
};
122+
}

0 commit comments

Comments
 (0)