11error: redundant pattern matching, consider using `is_ok()`
2- --> $DIR/redundant_pattern_matching.rs:14 :12
2+ --> $DIR/redundant_pattern_matching.rs:15 :12
33 |
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()`
66 |
77 = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
88
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+
915error: redundant pattern matching, consider using `is_err()`
10- --> $DIR/redundant_pattern_matching.rs:16 :12
16+ --> $DIR/redundant_pattern_matching.rs:19 :12
1117 |
1218LL | if let Err(_) = Err::<i32, i32>(42) {}
1319 | -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
1420
1521error: redundant pattern matching, consider using `is_none()`
16- --> $DIR/redundant_pattern_matching.rs:18 :12
22+ --> $DIR/redundant_pattern_matching.rs:21 :12
1723 |
1824LL | if let None = None::<()> {}
1925 | -------^^^^------------- help: try this: `if None::<()>.is_none()`
2026
2127error: redundant pattern matching, consider using `is_some()`
22- --> $DIR/redundant_pattern_matching.rs:20 :12
28+ --> $DIR/redundant_pattern_matching.rs:23 :12
2329 |
2430LL | if let Some(_) = Some(42) {}
2531 | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
2632
2733error: redundant pattern matching, consider using `is_some()`
28- --> $DIR/redundant_pattern_matching.rs:22 :12
34+ --> $DIR/redundant_pattern_matching.rs:25 :12
2935 |
3036LL | if let Some(_) = Some(42) {
3137 | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
3238
3339error: redundant pattern matching, consider using `is_some()`
34- --> $DIR/redundant_pattern_matching.rs:28 :15
40+ --> $DIR/redundant_pattern_matching.rs:31 :15
3541 |
3642LL | while let Some(_) = Some(42) {}
3743 | ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
3844
3945error: redundant pattern matching, consider using `is_none()`
40- --> $DIR/redundant_pattern_matching.rs:30 :15
46+ --> $DIR/redundant_pattern_matching.rs:33 :15
4147 |
4248LL | while let None = Some(42) {}
4349 | ----------^^^^----------- help: try this: `while Some(42).is_none()`
4450
4551error: redundant pattern matching, consider using `is_none()`
46- --> $DIR/redundant_pattern_matching.rs:32 :15
52+ --> $DIR/redundant_pattern_matching.rs:35 :15
4753 |
4854LL | while let None = None::<()> {}
4955 | ----------^^^^------------- help: try this: `while None::<()>.is_none()`
5056
5157error: redundant pattern matching, consider using `is_ok()`
52- --> $DIR/redundant_pattern_matching.rs:34 :15
58+ --> $DIR/redundant_pattern_matching.rs:37 :15
5359 |
5460LL | while let Ok(_) = Ok::<i32, i32>(10) {}
5561 | ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
5662
5763error: redundant pattern matching, consider using `is_err()`
58- --> $DIR/redundant_pattern_matching.rs:36 :15
64+ --> $DIR/redundant_pattern_matching.rs:39 :15
5965 |
6066LL | while let Err(_) = Ok::<i32, i32>(10) {}
6167 | ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
6268
6369error: redundant pattern matching, consider using `is_some()`
64- --> $DIR/redundant_pattern_matching.rs:39 :15
70+ --> $DIR/redundant_pattern_matching.rs:42 :15
6571 |
6672LL | while let Some(_) = v.pop() {
6773 | ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
6874
6975error: redundant pattern matching, consider using `is_ok()`
70- --> $DIR/redundant_pattern_matching.rs:55 :5
76+ --> $DIR/redundant_pattern_matching.rs:58 :5
7177 |
7278LL | / match Ok::<i32, i32>(42) {
7379LL | | Ok(_) => true,
@@ -76,7 +82,7 @@ LL | | };
7682 | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
7783
7884error: redundant pattern matching, consider using `is_err()`
79- --> $DIR/redundant_pattern_matching.rs:60 :5
85+ --> $DIR/redundant_pattern_matching.rs:63 :5
8086 |
8187LL | / match Ok::<i32, i32>(42) {
8288LL | | Ok(_) => false,
@@ -85,7 +91,7 @@ LL | | };
8591 | |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
8692
8793error: redundant pattern matching, consider using `is_err()`
88- --> $DIR/redundant_pattern_matching.rs:65 :5
94+ --> $DIR/redundant_pattern_matching.rs:68 :5
8995 |
9096LL | / match Err::<i32, i32>(42) {
9197LL | | Ok(_) => false,
@@ -94,7 +100,7 @@ LL | | };
94100 | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
95101
96102error: redundant pattern matching, consider using `is_ok()`
97- --> $DIR/redundant_pattern_matching.rs:70 :5
103+ --> $DIR/redundant_pattern_matching.rs:73 :5
98104 |
99105LL | / match Err::<i32, i32>(42) {
100106LL | | Ok(_) => true,
@@ -103,7 +109,7 @@ LL | | };
103109 | |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
104110
105111error: redundant pattern matching, consider using `is_some()`
106- --> $DIR/redundant_pattern_matching.rs:75 :5
112+ --> $DIR/redundant_pattern_matching.rs:78 :5
107113 |
108114LL | / match Some(42) {
109115LL | | Some(_) => true,
@@ -112,7 +118,7 @@ LL | | };
112118 | |_____^ help: try this: `Some(42).is_some()`
113119
114120error: redundant pattern matching, consider using `is_none()`
115- --> $DIR/redundant_pattern_matching.rs:80 :5
121+ --> $DIR/redundant_pattern_matching.rs:83 :5
116122 |
117123LL | / match None::<()> {
118124LL | | Some(_) => false,
@@ -121,7 +127,7 @@ LL | | };
121127 | |_____^ help: try this: `None::<()>.is_none()`
122128
123129error: redundant pattern matching, consider using `is_none()`
124- --> $DIR/redundant_pattern_matching.rs:85 :13
130+ --> $DIR/redundant_pattern_matching.rs:88 :13
125131 |
126132LL | let _ = match None::<()> {
127133 | _____________^
@@ -131,64 +137,64 @@ LL | | };
131137 | |_____^ help: try this: `None::<()>.is_none()`
132138
133139error: redundant pattern matching, consider using `is_ok()`
134- --> $DIR/redundant_pattern_matching.rs:90 :20
140+ --> $DIR/redundant_pattern_matching.rs:93 :20
135141 |
136142LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
137143 | -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
138144
139145error: redundant pattern matching, consider using `is_some()`
140- --> $DIR/redundant_pattern_matching.rs:93 :20
146+ --> $DIR/redundant_pattern_matching.rs:96 :20
141147 |
142148LL | let x = if let Some(_) = opt { true } else { false };
143149 | -------^^^^^^^------ help: try this: `if opt.is_some()`
144150
145151error: redundant pattern matching, consider using `is_some()`
146- --> $DIR/redundant_pattern_matching.rs:99 :20
152+ --> $DIR/redundant_pattern_matching.rs:102 :20
147153 |
148154LL | let _ = if let Some(_) = gen_opt() {
149155 | -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
150156
151157error: redundant pattern matching, consider using `is_none()`
152- --> $DIR/redundant_pattern_matching.rs:101 :19
158+ --> $DIR/redundant_pattern_matching.rs:104 :19
153159 |
154160LL | } else if let None = gen_opt() {
155161 | -------^^^^------------ help: try this: `if gen_opt().is_none()`
156162
157163error: redundant pattern matching, consider using `is_ok()`
158- --> $DIR/redundant_pattern_matching.rs:103 :19
164+ --> $DIR/redundant_pattern_matching.rs:106 :19
159165 |
160166LL | } else if let Ok(_) = gen_res() {
161167 | -------^^^^^------------ help: try this: `if gen_res().is_ok()`
162168
163169error: redundant pattern matching, consider using `is_err()`
164- --> $DIR/redundant_pattern_matching.rs:105 :19
170+ --> $DIR/redundant_pattern_matching.rs:108 :19
165171 |
166172LL | } else if let Err(_) = gen_res() {
167173 | -------^^^^^^------------ help: try this: `if gen_res().is_err()`
168174
169175error: redundant pattern matching, consider using `is_some()`
170- --> $DIR/redundant_pattern_matching.rs:138 :19
176+ --> $DIR/redundant_pattern_matching.rs:141 :19
171177 |
172178LL | while let Some(_) = r#try!(result_opt()) {}
173179 | ----------^^^^^^^----------------------- help: try this: `while r#try!(result_opt()).is_some()`
174180
175181error: redundant pattern matching, consider using `is_some()`
176- --> $DIR/redundant_pattern_matching.rs:139 :16
182+ --> $DIR/redundant_pattern_matching.rs:142 :16
177183 |
178184LL | if let Some(_) = r#try!(result_opt()) {}
179185 | -------^^^^^^^----------------------- help: try this: `if r#try!(result_opt()).is_some()`
180186
181187error: redundant pattern matching, consider using `is_some()`
182- --> $DIR/redundant_pattern_matching.rs:145 :12
188+ --> $DIR/redundant_pattern_matching.rs:148 :12
183189 |
184190LL | if let Some(_) = m!() {}
185191 | -------^^^^^^^------- help: try this: `if m!().is_some()`
186192
187193error: redundant pattern matching, consider using `is_some()`
188- --> $DIR/redundant_pattern_matching.rs:146 :15
194+ --> $DIR/redundant_pattern_matching.rs:149 :15
189195 |
190196LL | while let Some(_) = m!() {}
191197 | ----------^^^^^^^------- help: try this: `while m!().is_some()`
192198
193- error: aborting due to 28 previous errors
199+ error: aborting due to 29 previous errors
194200
0 commit comments