1
1
error: redundant pattern matching, consider using `is_none()`
2
- --> $DIR/redundant_pattern_matching_option.rs:15 :12
2
+ --> $DIR/redundant_pattern_matching_option.rs:19 :12
3
3
|
4
4
LL | if let None = None::<()> {}
5
5
| -------^^^^------------- help: try: `if None::<()>.is_none()`
6
6
|
7
7
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
8
8
9
9
error: redundant pattern matching, consider using `is_some()`
10
- --> $DIR/redundant_pattern_matching_option.rs:17 :12
10
+ --> $DIR/redundant_pattern_matching_option.rs:21 :12
11
11
|
12
12
LL | if let Some(_) = Some(42) {}
13
13
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
14
14
15
15
error: redundant pattern matching, consider using `is_some()`
16
- --> $DIR/redundant_pattern_matching_option.rs:19 :12
16
+ --> $DIR/redundant_pattern_matching_option.rs:23 :12
17
17
|
18
18
LL | if let Some(_) = Some(42) {
19
19
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
20
20
21
21
error: redundant pattern matching, consider using `is_some()`
22
- --> $DIR/redundant_pattern_matching_option.rs:25 :15
22
+ --> $DIR/redundant_pattern_matching_option.rs:29 :15
23
23
|
24
24
LL | while let Some(_) = Some(42) {}
25
25
| ----------^^^^^^^----------- help: try: `while Some(42).is_some()`
26
26
27
27
error: redundant pattern matching, consider using `is_none()`
28
- --> $DIR/redundant_pattern_matching_option.rs:27 :15
28
+ --> $DIR/redundant_pattern_matching_option.rs:31 :15
29
29
|
30
30
LL | while let None = Some(42) {}
31
31
| ----------^^^^----------- help: try: `while Some(42).is_none()`
32
32
33
33
error: redundant pattern matching, consider using `is_none()`
34
- --> $DIR/redundant_pattern_matching_option.rs:29 :15
34
+ --> $DIR/redundant_pattern_matching_option.rs:33 :15
35
35
|
36
36
LL | while let None = None::<()> {}
37
37
| ----------^^^^------------- help: try: `while None::<()>.is_none()`
38
38
39
39
error: redundant pattern matching, consider using `is_some()`
40
- --> $DIR/redundant_pattern_matching_option.rs:32 :15
40
+ --> $DIR/redundant_pattern_matching_option.rs:36 :15
41
41
|
42
42
LL | while let Some(_) = v.pop() {
43
43
| ----------^^^^^^^---------- help: try: `while v.pop().is_some()`
44
44
45
45
error: redundant pattern matching, consider using `is_some()`
46
- --> $DIR/redundant_pattern_matching_option.rs:40 :5
46
+ --> $DIR/redundant_pattern_matching_option.rs:44 :5
47
47
|
48
48
LL | / match Some(42) {
49
49
LL | | Some(_) => true,
@@ -52,7 +52,7 @@ LL | | };
52
52
| |_____^ help: try: `Some(42).is_some()`
53
53
54
54
error: redundant pattern matching, consider using `is_none()`
55
- --> $DIR/redundant_pattern_matching_option.rs:45 :5
55
+ --> $DIR/redundant_pattern_matching_option.rs:49 :5
56
56
|
57
57
LL | / match None::<()> {
58
58
LL | | Some(_) => false,
@@ -61,7 +61,7 @@ LL | | };
61
61
| |_____^ help: try: `None::<()>.is_none()`
62
62
63
63
error: redundant pattern matching, consider using `is_none()`
64
- --> $DIR/redundant_pattern_matching_option.rs:50 :13
64
+ --> $DIR/redundant_pattern_matching_option.rs:54 :13
65
65
|
66
66
LL | let _ = match None::<()> {
67
67
| _____________^
@@ -71,55 +71,55 @@ LL | | };
71
71
| |_____^ help: try: `None::<()>.is_none()`
72
72
73
73
error: redundant pattern matching, consider using `is_some()`
74
- --> $DIR/redundant_pattern_matching_option.rs:56 :20
74
+ --> $DIR/redundant_pattern_matching_option.rs:60 :20
75
75
|
76
76
LL | let _ = if let Some(_) = opt { true } else { false };
77
77
| -------^^^^^^^------ help: try: `if opt.is_some()`
78
78
79
79
error: redundant pattern matching, consider using `is_some()`
80
- --> $DIR/redundant_pattern_matching_option.rs:62 :20
80
+ --> $DIR/redundant_pattern_matching_option.rs:66 :20
81
81
|
82
82
LL | let _ = if let Some(_) = gen_opt() {
83
83
| -------^^^^^^^------------ help: try: `if gen_opt().is_some()`
84
84
85
85
error: redundant pattern matching, consider using `is_none()`
86
- --> $DIR/redundant_pattern_matching_option.rs:64 :19
86
+ --> $DIR/redundant_pattern_matching_option.rs:68 :19
87
87
|
88
88
LL | } else if let None = gen_opt() {
89
89
| -------^^^^------------ help: try: `if gen_opt().is_none()`
90
90
91
91
error: redundant pattern matching, consider using `is_some()`
92
- --> $DIR/redundant_pattern_matching_option.rs:70 :12
92
+ --> $DIR/redundant_pattern_matching_option.rs:74 :12
93
93
|
94
94
LL | if let Some(..) = gen_opt() {}
95
95
| -------^^^^^^^^------------ help: try: `if gen_opt().is_some()`
96
96
97
97
error: redundant pattern matching, consider using `is_some()`
98
- --> $DIR/redundant_pattern_matching_option.rs:85 :12
98
+ --> $DIR/redundant_pattern_matching_option.rs:89 :12
99
99
|
100
100
LL | if let Some(_) = Some(42) {}
101
101
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
102
102
103
103
error: redundant pattern matching, consider using `is_none()`
104
- --> $DIR/redundant_pattern_matching_option.rs:87 :12
104
+ --> $DIR/redundant_pattern_matching_option.rs:91 :12
105
105
|
106
106
LL | if let None = None::<()> {}
107
107
| -------^^^^------------- help: try: `if None::<()>.is_none()`
108
108
109
109
error: redundant pattern matching, consider using `is_some()`
110
- --> $DIR/redundant_pattern_matching_option.rs:89 :15
110
+ --> $DIR/redundant_pattern_matching_option.rs:93 :15
111
111
|
112
112
LL | while let Some(_) = Some(42) {}
113
113
| ----------^^^^^^^----------- help: try: `while Some(42).is_some()`
114
114
115
115
error: redundant pattern matching, consider using `is_none()`
116
- --> $DIR/redundant_pattern_matching_option.rs:91 :15
116
+ --> $DIR/redundant_pattern_matching_option.rs:95 :15
117
117
|
118
118
LL | while let None = None::<()> {}
119
119
| ----------^^^^------------- help: try: `while None::<()>.is_none()`
120
120
121
121
error: redundant pattern matching, consider using `is_some()`
122
- --> $DIR/redundant_pattern_matching_option.rs:93 :5
122
+ --> $DIR/redundant_pattern_matching_option.rs:97 :5
123
123
|
124
124
LL | / match Some(42) {
125
125
LL | | Some(_) => true,
@@ -128,7 +128,7 @@ LL | | };
128
128
| |_____^ help: try: `Some(42).is_some()`
129
129
130
130
error: redundant pattern matching, consider using `is_none()`
131
- --> $DIR/redundant_pattern_matching_option.rs:98 :5
131
+ --> $DIR/redundant_pattern_matching_option.rs:102 :5
132
132
|
133
133
LL | / match None::<()> {
134
134
LL | | Some(_) => false,
@@ -137,19 +137,19 @@ LL | | };
137
137
| |_____^ help: try: `None::<()>.is_none()`
138
138
139
139
error: redundant pattern matching, consider using `is_none()`
140
- --> $DIR/redundant_pattern_matching_option.rs:106 :12
140
+ --> $DIR/redundant_pattern_matching_option.rs:110 :12
141
141
|
142
142
LL | if let None = *(&None::<()>) {}
143
143
| -------^^^^----------------- help: try: `if (&None::<()>).is_none()`
144
144
145
145
error: redundant pattern matching, consider using `is_none()`
146
- --> $DIR/redundant_pattern_matching_option.rs:107 :12
146
+ --> $DIR/redundant_pattern_matching_option.rs:111 :12
147
147
|
148
148
LL | if let None = *&None::<()> {}
149
149
| -------^^^^--------------- help: try: `if (&None::<()>).is_none()`
150
150
151
151
error: redundant pattern matching, consider using `is_some()`
152
- --> $DIR/redundant_pattern_matching_option.rs:113 :5
152
+ --> $DIR/redundant_pattern_matching_option.rs:117 :5
153
153
|
154
154
LL | / match x {
155
155
LL | | Some(_) => true,
@@ -158,7 +158,7 @@ LL | | };
158
158
| |_____^ help: try: `x.is_some()`
159
159
160
160
error: redundant pattern matching, consider using `is_none()`
161
- --> $DIR/redundant_pattern_matching_option.rs:118 :5
161
+ --> $DIR/redundant_pattern_matching_option.rs:122 :5
162
162
|
163
163
LL | / match x {
164
164
LL | | None => true,
@@ -167,7 +167,7 @@ LL | | };
167
167
| |_____^ help: try: `x.is_none()`
168
168
169
169
error: redundant pattern matching, consider using `is_none()`
170
- --> $DIR/redundant_pattern_matching_option.rs:123 :5
170
+ --> $DIR/redundant_pattern_matching_option.rs:127 :5
171
171
|
172
172
LL | / match x {
173
173
LL | | Some(_) => false,
@@ -176,7 +176,7 @@ LL | | };
176
176
| |_____^ help: try: `x.is_none()`
177
177
178
178
error: redundant pattern matching, consider using `is_some()`
179
- --> $DIR/redundant_pattern_matching_option.rs:128 :5
179
+ --> $DIR/redundant_pattern_matching_option.rs:132 :5
180
180
|
181
181
LL | / match x {
182
182
LL | | None => false,
@@ -185,13 +185,13 @@ LL | | };
185
185
| |_____^ help: try: `x.is_some()`
186
186
187
187
error: redundant pattern matching, consider using `is_some()`
188
- --> $DIR/redundant_pattern_matching_option.rs:143 :13
188
+ --> $DIR/redundant_pattern_matching_option.rs:147 :13
189
189
|
190
190
LL | let _ = matches!(x, Some(_));
191
191
| ^^^^^^^^^^^^^^^^^^^^ help: try: `x.is_some()`
192
192
193
193
error: redundant pattern matching, consider using `is_none()`
194
- --> $DIR/redundant_pattern_matching_option.rs:145 :13
194
+ --> $DIR/redundant_pattern_matching_option.rs:149 :13
195
195
|
196
196
LL | let _ = matches!(x, None);
197
197
| ^^^^^^^^^^^^^^^^^ help: try: `x.is_none()`
0 commit comments