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