Skip to content

Commit 0f513fc

Browse files
committed
creating suggestion
1 parent c04c189 commit 0f513fc

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

clippy_lints/src/if_let_mutex.rs

+1-1
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

+8
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ fn main() {
6464

6565
let _ = does_something();
6666
let _ = returns_unit();
67+
let _ = issue_5271();
6768

6869
let opt = Some(false);
6970
let x = if let Some(_) = opt { true } else { false };
@@ -87,3 +88,10 @@ fn returns_unit() {
8788
false
8889
};
8990
}
91+
92+
fn issue_5271() {
93+
let hello = Some(String::from("hello"));
94+
let _x = match hello {
95+
s @ _ => drop(s),
96+
};
97+
}

0 commit comments

Comments
 (0)