1 error: redundant pattern matching, consider using `is_ok()`
2 --> $DIR/redundant_pattern_matching.rs:10:12
4 LL | if let Ok(_) = Ok::<i32, i32>(42) {}
5 | -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
7 = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
9 error: redundant pattern matching, consider using `is_err()`
10 --> $DIR/redundant_pattern_matching.rs:12:12
12 LL | if let Err(_) = Err::<i32, i32>(42) {}
13 | -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
15 error: redundant pattern matching, consider using `is_none()`
16 --> $DIR/redundant_pattern_matching.rs:14:12
18 LL | if let None = None::<()> {}
19 | -------^^^^------------- help: try this: `if None::<()>.is_none()`
21 error: redundant pattern matching, consider using `is_some()`
22 --> $DIR/redundant_pattern_matching.rs:16:12
24 LL | if let Some(_) = Some(42) {}
25 | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
27 error: redundant pattern matching, consider using `is_some()`
28 --> $DIR/redundant_pattern_matching.rs:18: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:24:15
36 LL | while let Some(_) = Some(42) {}
37 | ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
39 error: redundant pattern matching, consider using `is_none()`
40 --> $DIR/redundant_pattern_matching.rs:26:15
42 LL | while let None = Some(42) {}
43 | ----------^^^^----------- help: try this: `while Some(42).is_none()`
45 error: redundant pattern matching, consider using `is_none()`
46 --> $DIR/redundant_pattern_matching.rs:28:15
48 LL | while let None = None::<()> {}
49 | ----------^^^^------------- help: try this: `while None::<()>.is_none()`
51 error: redundant pattern matching, consider using `is_ok()`
52 --> $DIR/redundant_pattern_matching.rs:30:15
54 LL | while let Ok(_) = Ok::<i32, i32>(10) {}
55 | ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
57 error: redundant pattern matching, consider using `is_err()`
58 --> $DIR/redundant_pattern_matching.rs:32:15
60 LL | while let Err(_) = Ok::<i32, i32>(10) {}
61 | ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
63 error: redundant pattern matching, consider using `is_some()`
64 --> $DIR/redundant_pattern_matching.rs:35:15
66 LL | while let Some(_) = v.pop() {
67 | ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
69 error: redundant pattern matching, consider using `is_ok()`
70 --> $DIR/redundant_pattern_matching.rs:51:5
72 LL | / match Ok::<i32, i32>(42) {
74 LL | | Err(_) => false,
76 | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
78 error: redundant pattern matching, consider using `is_err()`
79 --> $DIR/redundant_pattern_matching.rs:56:5
81 LL | / match Ok::<i32, i32>(42) {
82 LL | | Ok(_) => false,
83 LL | | Err(_) => true,
85 | |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
87 error: redundant pattern matching, consider using `is_err()`
88 --> $DIR/redundant_pattern_matching.rs:61:5
90 LL | / match Err::<i32, i32>(42) {
91 LL | | Ok(_) => false,
92 LL | | Err(_) => true,
94 | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
96 error: redundant pattern matching, consider using `is_ok()`
97 --> $DIR/redundant_pattern_matching.rs:66:5
99 LL | / match Err::<i32, i32>(42) {
100 LL | | Ok(_) => true,
101 LL | | Err(_) => false,
103 | |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
105 error: redundant pattern matching, consider using `is_some()`
106 --> $DIR/redundant_pattern_matching.rs:71:5
108 LL | / match Some(42) {
109 LL | | Some(_) => true,
110 LL | | None => false,
112 | |_____^ help: try this: `Some(42).is_some()`
114 error: redundant pattern matching, consider using `is_none()`
115 --> $DIR/redundant_pattern_matching.rs:76:5
117 LL | / match None::<()> {
118 LL | | Some(_) => false,
121 | |_____^ help: try this: `None::<()>.is_none()`
123 error: redundant pattern matching, consider using `is_none()`
124 --> $DIR/redundant_pattern_matching.rs:81:13
126 LL | let _ = match None::<()> {
128 LL | | Some(_) => false,
131 | |_____^ help: try this: `None::<()>.is_none()`
133 error: redundant pattern matching, consider using `is_ok()`
134 --> $DIR/redundant_pattern_matching.rs:86:20
136 LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
137 | -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
139 error: redundant pattern matching, consider using `is_some()`
140 --> $DIR/redundant_pattern_matching.rs:89:20
142 LL | let x = if let Some(_) = opt { true } else { false };
143 | -------^^^^^^^------ help: try this: `if opt.is_some()`
145 error: redundant pattern matching, consider using `is_some()`
146 --> $DIR/redundant_pattern_matching.rs:95:20
148 LL | let _ = if let Some(_) = gen_opt() {
149 | -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
151 error: redundant pattern matching, consider using `is_none()`
152 --> $DIR/redundant_pattern_matching.rs:97:19
154 LL | } else if let None = gen_opt() {
155 | -------^^^^------------ help: try this: `if gen_opt().is_none()`
157 error: redundant pattern matching, consider using `is_ok()`
158 --> $DIR/redundant_pattern_matching.rs:99:19
160 LL | } else if let Ok(_) = gen_res() {
161 | -------^^^^^------------ help: try this: `if gen_res().is_ok()`
163 error: redundant pattern matching, consider using `is_err()`
164 --> $DIR/redundant_pattern_matching.rs:101:19
166 LL | } else if let Err(_) = gen_res() {
167 | -------^^^^^^------------ help: try this: `if gen_res().is_err()`
169 error: redundant pattern matching, consider using `is_some()`
170 --> $DIR/redundant_pattern_matching.rs:134:19
172 LL | while let Some(_) = r#try!(result_opt()) {}
173 | ----------^^^^^^^----------------------- help: try this: `while r#try!(result_opt()).is_some()`
175 error: redundant pattern matching, consider using `is_some()`
176 --> $DIR/redundant_pattern_matching.rs:135:16
178 LL | if let Some(_) = r#try!(result_opt()) {}
179 | -------^^^^^^^----------------------- help: try this: `if r#try!(result_opt()).is_some()`
181 error: redundant pattern matching, consider using `is_some()`
182 --> $DIR/redundant_pattern_matching.rs:141:12
184 LL | if let Some(_) = m!() {}
185 | -------^^^^^^^------- help: try this: `if m!().is_some()`
187 error: redundant pattern matching, consider using `is_some()`
188 --> $DIR/redundant_pattern_matching.rs:142:15
190 LL | while let Some(_) = m!() {}
191 | ----------^^^^^^^------- help: try this: `while m!().is_some()`
193 error: aborting due to 28 previous errors