Skip to content

Commit c6f51fa

Browse files
committed
Allow local match_single_binding
1 parent 598bf97 commit c6f51fa

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/ui/match_ref_pats.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fn ref_pats() {
2626
}
2727
// False positive: only wildcard pattern.
2828
let w = Some(0);
29+
#[allow(clippy::match_single_binding)]
2930
match w {
3031
_ => println!("none"),
3132
}

tests/ui/match_ref_pats.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ LL | None => println!("none"),
4747
|
4848

4949
error: you don't need to add `&` to all patterns
50-
--> $DIR/match_ref_pats.rs:34:5
50+
--> $DIR/match_ref_pats.rs:35:5
5151
|
5252
LL | / if let &None = a {
5353
LL | | println!("none");
@@ -60,7 +60,7 @@ LL | if let None = *a {
6060
| ^^^^ ^^
6161

6262
error: you don't need to add `&` to both the expression and the patterns
63-
--> $DIR/match_ref_pats.rs:39:5
63+
--> $DIR/match_ref_pats.rs:40:5
6464
|
6565
LL | / if let &None = &b {
6666
LL | | println!("none");
@@ -73,7 +73,7 @@ LL | if let None = b {
7373
| ^^^^ ^
7474

7575
error: you don't need to add `&` to all patterns
76-
--> $DIR/match_ref_pats.rs:66:9
76+
--> $DIR/match_ref_pats.rs:67:9
7777
|
7878
LL | / match foo_variant!(0) {
7979
LL | | &Foo::A => println!("A"),

0 commit comments

Comments
 (0)