Skip to content

Commit 2746632

Browse files
committed
Auto merge of rust-lang#6766 - matthiaskrgr:nestedmatch, r=flip1995
collapsible_match: fix lint message capitalization (see https://rustc-dev-guide.rust-lang.org/diagnostics.html for details) --- *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: collapsible_match: fix lint message capitalization
2 parents 23de801 + 1f4153a commit 2746632

File tree

3 files changed

+48
-48
lines changed

3 files changed

+48
-48
lines changed

clippy_lints/src/collapsible_match.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ fn check_arm<'tcx>(arm: &Arm<'tcx>, wild_outer_arm: &Arm<'tcx>, cx: &LateContext
9696
cx,
9797
COLLAPSIBLE_MATCH,
9898
expr.span,
99-
"Unnecessary nested match",
99+
"unnecessary nested match",
100100
|diag| {
101101
let mut help_span = MultiSpan::from_spans(vec![binding_span, non_wild_inner_arm.pat.span]);
102-
help_span.push_span_label(binding_span, "Replace this binding".into());
102+
help_span.push_span_label(binding_span, "replace this binding".into());
103103
help_span.push_span_label(non_wild_inner_arm.pat.span, "with this pattern".into());
104-
diag.span_help(help_span, "The outer pattern can be modified to include the inner pattern.");
104+
diag.span_help(help_span, "the outer pattern can be modified to include the inner pattern");
105105
},
106106
);
107107
}

tests/ui/collapsible_match.stderr

+30-30
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Unnecessary nested match
1+
error: unnecessary nested match
22
--> $DIR/collapsible_match.rs:7:20
33
|
44
LL | Ok(val) => match val {
@@ -9,15 +9,15 @@ LL | | },
99
| |_________^
1010
|
1111
= note: `-D clippy::collapsible-match` implied by `-D warnings`
12-
help: The outer pattern can be modified to include the inner pattern.
12+
help: the outer pattern can be modified to include the inner pattern
1313
--> $DIR/collapsible_match.rs:7:12
1414
|
1515
LL | Ok(val) => match val {
16-
| ^^^ Replace this binding
16+
| ^^^ replace this binding
1717
LL | Some(n) => foo(n),
1818
| ^^^^^^^ with this pattern
1919

20-
error: Unnecessary nested match
20+
error: unnecessary nested match
2121
--> $DIR/collapsible_match.rs:16:20
2222
|
2323
LL | Ok(val) => match val {
@@ -27,31 +27,31 @@ LL | | _ => return,
2727
LL | | },
2828
| |_________^
2929
|
30-
help: The outer pattern can be modified to include the inner pattern.
30+
help: the outer pattern can be modified to include the inner pattern
3131
--> $DIR/collapsible_match.rs:16:12
3232
|
3333
LL | Ok(val) => match val {
34-
| ^^^ Replace this binding
34+
| ^^^ replace this binding
3535
LL | Some(n) => foo(n),
3636
| ^^^^^^^ with this pattern
3737

38-
error: Unnecessary nested match
38+
error: unnecessary nested match
3939
--> $DIR/collapsible_match.rs:25:9
4040
|
4141
LL | / if let Some(n) = val {
4242
LL | | take(n);
4343
LL | | }
4444
| |_________^
4545
|
46-
help: The outer pattern can be modified to include the inner pattern.
46+
help: the outer pattern can be modified to include the inner pattern
4747
--> $DIR/collapsible_match.rs:24:15
4848
|
4949
LL | if let Ok(val) = res_opt {
50-
| ^^^ Replace this binding
50+
| ^^^ replace this binding
5151
LL | if let Some(n) = val {
5252
| ^^^^^^^ with this pattern
5353

54-
error: Unnecessary nested match
54+
error: unnecessary nested match
5555
--> $DIR/collapsible_match.rs:32:9
5656
|
5757
LL | / if let Some(n) = val {
@@ -61,15 +61,15 @@ LL | | return;
6161
LL | | }
6262
| |_________^
6363
|
64-
help: The outer pattern can be modified to include the inner pattern.
64+
help: the outer pattern can be modified to include the inner pattern
6565
--> $DIR/collapsible_match.rs:31:15
6666
|
6767
LL | if let Ok(val) = res_opt {
68-
| ^^^ Replace this binding
68+
| ^^^ replace this binding
6969
LL | if let Some(n) = val {
7070
| ^^^^^^^ with this pattern
7171

72-
error: Unnecessary nested match
72+
error: unnecessary nested match
7373
--> $DIR/collapsible_match.rs:43:9
7474
|
7575
LL | / match val {
@@ -78,32 +78,32 @@ LL | | _ => (),
7878
LL | | }
7979
| |_________^
8080
|
81-
help: The outer pattern can be modified to include the inner pattern.
81+
help: the outer pattern can be modified to include the inner pattern
8282
--> $DIR/collapsible_match.rs:42:15
8383
|
8484
LL | if let Ok(val) = res_opt {
85-
| ^^^ Replace this binding
85+
| ^^^ replace this binding
8686
LL | match val {
8787
LL | Some(n) => foo(n),
8888
| ^^^^^^^ with this pattern
8989

90-
error: Unnecessary nested match
90+
error: unnecessary nested match
9191
--> $DIR/collapsible_match.rs:52:13
9292
|
9393
LL | / if let Some(n) = val {
9494
LL | | take(n);
9595
LL | | }
9696
| |_____________^
9797
|
98-
help: The outer pattern can be modified to include the inner pattern.
98+
help: the outer pattern can be modified to include the inner pattern
9999
--> $DIR/collapsible_match.rs:51:12
100100
|
101101
LL | Ok(val) => {
102-
| ^^^ Replace this binding
102+
| ^^^ replace this binding
103103
LL | if let Some(n) = val {
104104
| ^^^^^^^ with this pattern
105105

106-
error: Unnecessary nested match
106+
error: unnecessary nested match
107107
--> $DIR/collapsible_match.rs:61:9
108108
|
109109
LL | / match val {
@@ -112,16 +112,16 @@ LL | | _ => return,
112112
LL | | }
113113
| |_________^
114114
|
115-
help: The outer pattern can be modified to include the inner pattern.
115+
help: the outer pattern can be modified to include the inner pattern
116116
--> $DIR/collapsible_match.rs:60:15
117117
|
118118
LL | if let Ok(val) = res_opt {
119-
| ^^^ Replace this binding
119+
| ^^^ replace this binding
120120
LL | match val {
121121
LL | Some(n) => foo(n),
122122
| ^^^^^^^ with this pattern
123123

124-
error: Unnecessary nested match
124+
error: unnecessary nested match
125125
--> $DIR/collapsible_match.rs:72:13
126126
|
127127
LL | / if let Some(n) = val {
@@ -131,15 +131,15 @@ LL | | return;
131131
LL | | }
132132
| |_____________^
133133
|
134-
help: The outer pattern can be modified to include the inner pattern.
134+
help: the outer pattern can be modified to include the inner pattern
135135
--> $DIR/collapsible_match.rs:71:12
136136
|
137137
LL | Ok(val) => {
138-
| ^^^ Replace this binding
138+
| ^^^ replace this binding
139139
LL | if let Some(n) = val {
140140
| ^^^^^^^ with this pattern
141141

142-
error: Unnecessary nested match
142+
error: unnecessary nested match
143143
--> $DIR/collapsible_match.rs:83:20
144144
|
145145
LL | Ok(val) => match val {
@@ -149,15 +149,15 @@ LL | | None => return,
149149
LL | | },
150150
| |_________^
151151
|
152-
help: The outer pattern can be modified to include the inner pattern.
152+
help: the outer pattern can be modified to include the inner pattern
153153
--> $DIR/collapsible_match.rs:83:12
154154
|
155155
LL | Ok(val) => match val {
156-
| ^^^ Replace this binding
156+
| ^^^ replace this binding
157157
LL | Some(n) => foo(n),
158158
| ^^^^^^^ with this pattern
159159

160-
error: Unnecessary nested match
160+
error: unnecessary nested match
161161
--> $DIR/collapsible_match.rs:92:22
162162
|
163163
LL | Some(val) => match val {
@@ -167,11 +167,11 @@ LL | | _ => return,
167167
LL | | },
168168
| |_________^
169169
|
170-
help: The outer pattern can be modified to include the inner pattern.
170+
help: the outer pattern can be modified to include the inner pattern
171171
--> $DIR/collapsible_match.rs:92:14
172172
|
173173
LL | Some(val) => match val {
174-
| ^^^ Replace this binding
174+
| ^^^ replace this binding
175175
LL | Some(n) => foo(n),
176176
| ^^^^^^^ with this pattern
177177

tests/ui/collapsible_match2.stderr

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Unnecessary nested match
1+
error: unnecessary nested match
22
--> $DIR/collapsible_match2.rs:8:34
33
|
44
LL | Ok(val) if make() => match val {
@@ -9,15 +9,15 @@ LL | | },
99
| |_____________^
1010
|
1111
= note: `-D clippy::collapsible-match` implied by `-D warnings`
12-
help: The outer pattern can be modified to include the inner pattern.
12+
help: the outer pattern can be modified to include the inner pattern
1313
--> $DIR/collapsible_match2.rs:8:16
1414
|
1515
LL | Ok(val) if make() => match val {
16-
| ^^^ Replace this binding
16+
| ^^^ replace this binding
1717
LL | Some(n) => foo(n),
1818
| ^^^^^^^ with this pattern
1919

20-
error: Unnecessary nested match
20+
error: unnecessary nested match
2121
--> $DIR/collapsible_match2.rs:15:24
2222
|
2323
LL | Ok(val) => match val {
@@ -27,15 +27,15 @@ LL | | _ => return,
2727
LL | | },
2828
| |_____________^
2929
|
30-
help: The outer pattern can be modified to include the inner pattern.
30+
help: the outer pattern can be modified to include the inner pattern
3131
--> $DIR/collapsible_match2.rs:15:16
3232
|
3333
LL | Ok(val) => match val {
34-
| ^^^ Replace this binding
34+
| ^^^ replace this binding
3535
LL | Some(n) => foo(n),
3636
| ^^^^^^^ with this pattern
3737

38-
error: Unnecessary nested match
38+
error: unnecessary nested match
3939
--> $DIR/collapsible_match2.rs:29:29
4040
|
4141
LL | $pat => match $e {
@@ -48,16 +48,16 @@ LL | | },
4848
LL | mac!(res_opt => Ok(val), val => Some(n), foo(n));
4949
| ------------------------------------------------- in this macro invocation
5050
|
51-
help: The outer pattern can be modified to include the inner pattern.
51+
help: the outer pattern can be modified to include the inner pattern
5252
--> $DIR/collapsible_match2.rs:41:28
5353
|
5454
LL | mac!(res_opt => Ok(val), val => Some(n), foo(n));
5555
| ^^^ ^^^^^^^ with this pattern
5656
| |
57-
| Replace this binding
57+
| replace this binding
5858
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
5959

60-
error: Unnecessary nested match
60+
error: unnecessary nested match
6161
--> $DIR/collapsible_match2.rs:46:20
6262
|
6363
LL | Some(s) => match *s {
@@ -67,15 +67,15 @@ LL | | _ => (),
6767
LL | | },
6868
| |_________^
6969
|
70-
help: The outer pattern can be modified to include the inner pattern.
70+
help: the outer pattern can be modified to include the inner pattern
7171
--> $DIR/collapsible_match2.rs:46:14
7272
|
7373
LL | Some(s) => match *s {
74-
| ^ Replace this binding
74+
| ^ replace this binding
7575
LL | [n] => foo(n),
7676
| ^^^ with this pattern
7777

78-
error: Unnecessary nested match
78+
error: unnecessary nested match
7979
--> $DIR/collapsible_match2.rs:55:24
8080
|
8181
LL | Some(ref s) => match &*s {
@@ -85,11 +85,11 @@ LL | | _ => (),
8585
LL | | },
8686
| |_________^
8787
|
88-
help: The outer pattern can be modified to include the inner pattern.
88+
help: the outer pattern can be modified to include the inner pattern
8989
--> $DIR/collapsible_match2.rs:55:14
9090
|
9191
LL | Some(ref s) => match &*s {
92-
| ^^^^^ Replace this binding
92+
| ^^^^^ replace this binding
9393
LL | [n] => foo(n),
9494
| ^^^ with this pattern
9595

0 commit comments

Comments
 (0)