1 error: redundant pattern matching, consider using `is_ok()`
2 --> $DIR/redundant_pattern_matching.rs:15:12
4 LL | if let Ok(_) = &result {}
5 | -------^^^^^---------- help: try this: `if result.is_ok()`
7 = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
9 error: redundant pattern matching, consider using `is_ok()`
10 --> $DIR/redundant_pattern_matching.rs:17:12
12 LL | if let Ok(_) = Ok::<i32, i32>(42) {}
13 | -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
15 error: redundant pattern matching, consider using `is_err()`
16 --> $DIR/redundant_pattern_matching.rs:19:12
18 LL | if let Err(_) = Err::<i32, i32>(42) {}
19 | -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
21 error: redundant pattern matching, consider using `is_none()`
22 --> $DIR/redundant_pattern_matching.rs:21:12
24 LL | if let None = None::<()> {}
25 | -------^^^^------------- help: try this: `if None::<()>.is_none()`
27 error: redundant pattern matching, consider using `is_some()`
28 --> $DIR/redundant_pattern_matching.rs:23:12
30 LL | if let Some(_) = Some(42) {}
31 | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
33 error: redundant pattern matching, consider using `is_some()`
34 --> $DIR/redundant_pattern_matching.rs:25:12
36 LL | if let Some(_) = Some(42) {
37 | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
39 error: redundant pattern matching, consider using `is_some()`
40 --> $DIR/redundant_pattern_matching.rs:31:15
42 LL | while let Some(_) = Some(42) {}
43 | ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
45 error: redundant pattern matching, consider using `is_none()`
46 --> $DIR/redundant_pattern_matching.rs:33:15
48 LL | while let None = Some(42) {}
49 | ----------^^^^----------- help: try this: `while Some(42).is_none()`
51 error: redundant pattern matching, consider using `is_none()`
52 --> $DIR/redundant_pattern_matching.rs:35:15
54 LL | while let None = None::<()> {}
55 | ----------^^^^------------- help: try this: `while None::<()>.is_none()`
57 error: redundant pattern matching, consider using `is_ok()`
58 --> $DIR/redundant_pattern_matching.rs:37:15
60 LL | while let Ok(_) = Ok::<i32, i32>(10) {}
61 | ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
63 error: redundant pattern matching, consider using `is_err()`
64 --> $DIR/redundant_pattern_matching.rs:39:15
66 LL | while let Err(_) = Ok::<i32, i32>(10) {}
67 | ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
69 error: redundant pattern matching, consider using `is_some()`
70 --> $DIR/redundant_pattern_matching.rs:42:15
72 LL | while let Some(_) = v.pop() {
73 | ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
75 error: redundant pattern matching, consider using `is_ok()`
76 --> $DIR/redundant_pattern_matching.rs:58:5
78 LL | / match Ok::<i32, i32>(42) {
80 LL | | Err(_) => false,
82 | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
84 error: redundant pattern matching, consider using `is_err()`
85 --> $DIR/redundant_pattern_matching.rs:63:5
87 LL | / match Ok::<i32, i32>(42) {
88 LL | | Ok(_) => false,
89 LL | | Err(_) => true,
91 | |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
93 error: redundant pattern matching, consider using `is_err()`
94 --> $DIR/redundant_pattern_matching.rs:68:5
96 LL | / match Err::<i32, i32>(42) {
97 LL | | Ok(_) => false,
98 LL | | Err(_) => true,
100 | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
102 error: redundant pattern matching, consider using `is_ok()`
103 --> $DIR/redundant_pattern_matching.rs:73:5
105 LL | / match Err::<i32, i32>(42) {
106 LL | | Ok(_) => true,
107 LL | | Err(_) => false,
109 | |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
111 error: redundant pattern matching, consider using `is_some()`
112 --> $DIR/redundant_pattern_matching.rs:78:5
114 LL | / match Some(42) {
115 LL | | Some(_) => true,
116 LL | | None => false,
118 | |_____^ help: try this: `Some(42).is_some()`
120 error: redundant pattern matching, consider using `is_none()`
121 --> $DIR/redundant_pattern_matching.rs:83:5
123 LL | / match None::<()> {
124 LL | | Some(_) => false,
127 | |_____^ help: try this: `None::<()>.is_none()`
129 error: redundant pattern matching, consider using `is_none()`
130 --> $DIR/redundant_pattern_matching.rs:88:13
132 LL | let _ = match None::<()> {
134 LL | | Some(_) => false,
137 | |_____^ help: try this: `None::<()>.is_none()`
139 error: redundant pattern matching, consider using `is_ok()`
140 --> $DIR/redundant_pattern_matching.rs:93:20
142 LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
143 | -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
145 error: redundant pattern matching, consider using `is_some()`
146 --> $DIR/redundant_pattern_matching.rs:96:20
148 LL | let x = if let Some(_) = opt { true } else { false };
149 | -------^^^^^^^------ help: try this: `if opt.is_some()`
151 error: redundant pattern matching, consider using `is_some()`
152 --> $DIR/redundant_pattern_matching.rs:102:20
154 LL | let _ = if let Some(_) = gen_opt() {
155 | -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
157 error: redundant pattern matching, consider using `is_none()`
158 --> $DIR/redundant_pattern_matching.rs:104:19
160 LL | } else if let None = gen_opt() {
161 | -------^^^^------------ help: try this: `if gen_opt().is_none()`
163 error: redundant pattern matching, consider using `is_ok()`
164 --> $DIR/redundant_pattern_matching.rs:106:19
166 LL | } else if let Ok(_) = gen_res() {
167 | -------^^^^^------------ help: try this: `if gen_res().is_ok()`
169 error: redundant pattern matching, consider using `is_err()`
170 --> $DIR/redundant_pattern_matching.rs:108:19
172 LL | } else if let Err(_) = gen_res() {
173 | -------^^^^^^------------ help: try this: `if gen_res().is_err()`
175 error: redundant pattern matching, consider using `is_some()`
176 --> $DIR/redundant_pattern_matching.rs:141:19
178 LL | while let Some(_) = r#try!(result_opt()) {}
179 | ----------^^^^^^^----------------------- help: try this: `while r#try!(result_opt()).is_some()`
181 error: redundant pattern matching, consider using `is_some()`
182 --> $DIR/redundant_pattern_matching.rs:142:16
184 LL | if let Some(_) = r#try!(result_opt()) {}
185 | -------^^^^^^^----------------------- help: try this: `if r#try!(result_opt()).is_some()`
187 error: redundant pattern matching, consider using `is_some()`
188 --> $DIR/redundant_pattern_matching.rs:148:12
190 LL | if let Some(_) = m!() {}
191 | -------^^^^^^^------- help: try this: `if m!().is_some()`
193 error: redundant pattern matching, consider using `is_some()`
194 --> $DIR/redundant_pattern_matching.rs:149:15
196 LL | while let Some(_) = m!() {}
197 | ----------^^^^^^^------- help: try this: `while m!().is_some()`
199 error: redundant pattern matching, consider using `is_ok()`
200 --> $DIR/redundant_pattern_matching.rs:156:12
202 LL | if let Ok(_) = Ok::<i32, i32>(42) {}
203 | -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
205 error: redundant pattern matching, consider using `is_err()`
206 --> $DIR/redundant_pattern_matching.rs:158:12
208 LL | if let Err(_) = Err::<i32, i32>(42) {}
209 | -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
211 error: redundant pattern matching, consider using `is_some()`
212 --> $DIR/redundant_pattern_matching.rs:160:12
214 LL | if let Some(_) = Some(42) {}
215 | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
217 error: redundant pattern matching, consider using `is_none()`
218 --> $DIR/redundant_pattern_matching.rs:162:12
220 LL | if let None = None::<()> {}
221 | -------^^^^------------- help: try this: `if None::<()>.is_none()`
223 error: redundant pattern matching, consider using `is_ok()`
224 --> $DIR/redundant_pattern_matching.rs:164:15
226 LL | while let Ok(_) = Ok::<i32, i32>(10) {}
227 | ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
229 error: redundant pattern matching, consider using `is_err()`
230 --> $DIR/redundant_pattern_matching.rs:166:15
232 LL | while let Err(_) = Ok::<i32, i32>(10) {}
233 | ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
235 error: redundant pattern matching, consider using `is_some()`
236 --> $DIR/redundant_pattern_matching.rs:168:15
238 LL | while let Some(_) = Some(42) {}
239 | ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
241 error: redundant pattern matching, consider using `is_none()`
242 --> $DIR/redundant_pattern_matching.rs:170:15
244 LL | while let None = None::<()> {}
245 | ----------^^^^------------- help: try this: `while None::<()>.is_none()`
247 error: redundant pattern matching, consider using `is_ok()`
248 --> $DIR/redundant_pattern_matching.rs:172:5
250 LL | / match Ok::<i32, i32>(42) {
251 LL | | Ok(_) => true,
252 LL | | Err(_) => false,
254 | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
256 error: redundant pattern matching, consider using `is_err()`
257 --> $DIR/redundant_pattern_matching.rs:177:5
259 LL | / match Err::<i32, i32>(42) {
260 LL | | Ok(_) => false,
261 LL | | Err(_) => true,
263 | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
265 error: redundant pattern matching, consider using `is_some()`
266 --> $DIR/redundant_pattern_matching.rs:182:5
268 LL | / match Some(42) {
269 LL | | Some(_) => true,
270 LL | | None => false,
272 | |_____^ help: try this: `Some(42).is_some()`
274 error: redundant pattern matching, consider using `is_none()`
275 --> $DIR/redundant_pattern_matching.rs:187:5
277 LL | / match None::<()> {
278 LL | | Some(_) => false,
281 | |_____^ help: try this: `None::<()>.is_none()`
283 error: aborting due to 41 previous errors