11error: redundant pattern matching, consider using `is_ok()`
2- --> $DIR/redundant_pattern_matching.rs:10 :12
2+ --> $DIR/redundant_pattern_matching.rs:8 :12
33 |
44LL | if let Ok(_) = Ok::<i32, i32>(42) {}
55 | -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
66 |
77 = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
88
99error: redundant pattern matching, consider using `is_err()`
10- --> $DIR/redundant_pattern_matching.rs:12 :12
10+ --> $DIR/redundant_pattern_matching.rs:10 :12
1111 |
1212LL | if let Err(_) = Err::<i32, i32>(42) {}
1313 | -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
1414
1515error: redundant pattern matching, consider using `is_none()`
16- --> $DIR/redundant_pattern_matching.rs:14 :12
16+ --> $DIR/redundant_pattern_matching.rs:12 :12
1717 |
1818LL | if let None = None::<()> {}
1919 | -------^^^^------------- help: try this: `if None::<()>.is_none()`
2020
2121error: redundant pattern matching, consider using `is_some()`
22- --> $DIR/redundant_pattern_matching.rs:16 :12
22+ --> $DIR/redundant_pattern_matching.rs:14 :12
2323 |
2424LL | if let Some(_) = Some(42) {}
2525 | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
2626
2727error: redundant pattern matching, consider using `is_some()`
28- --> $DIR/redundant_pattern_matching.rs:18 :12
28+ --> $DIR/redundant_pattern_matching.rs:16 :12
2929 |
3030LL | if let Some(_) = Some(42) {
3131 | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
3232
3333error: redundant pattern matching, consider using `is_some()`
34- --> $DIR/redundant_pattern_matching.rs:24 :15
34+ --> $DIR/redundant_pattern_matching.rs:22 :15
3535 |
3636LL | while let Some(_) = Some(42) {}
3737 | ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
3838
3939error: redundant pattern matching, consider using `is_none()`
40- --> $DIR/redundant_pattern_matching.rs:26 :15
40+ --> $DIR/redundant_pattern_matching.rs:24 :15
4141 |
4242LL | while let None = Some(42) {}
4343 | ----------^^^^----------- help: try this: `while Some(42).is_none()`
4444
4545error: redundant pattern matching, consider using `is_none()`
46- --> $DIR/redundant_pattern_matching.rs:28 :15
46+ --> $DIR/redundant_pattern_matching.rs:26 :15
4747 |
4848LL | while let None = None::<()> {}
4949 | ----------^^^^------------- help: try this: `while None::<()>.is_none()`
5050
5151error: redundant pattern matching, consider using `is_ok()`
52- --> $DIR/redundant_pattern_matching.rs:30 :15
52+ --> $DIR/redundant_pattern_matching.rs:28 :15
5353 |
5454LL | while let Ok(_) = Ok::<i32, i32>(10) {}
5555 | ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
5656
5757error: redundant pattern matching, consider using `is_err()`
58- --> $DIR/redundant_pattern_matching.rs:32 :15
58+ --> $DIR/redundant_pattern_matching.rs:30 :15
5959 |
6060LL | while let Err(_) = Ok::<i32, i32>(10) {}
6161 | ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
6262
6363error: redundant pattern matching, consider using `is_some()`
64- --> $DIR/redundant_pattern_matching.rs:35 :15
64+ --> $DIR/redundant_pattern_matching.rs:33 :15
6565 |
6666LL | while let Some(_) = v.pop() {
6767 | ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
6868
6969error: redundant pattern matching, consider using `is_ok()`
70- --> $DIR/redundant_pattern_matching.rs:51 :5
70+ --> $DIR/redundant_pattern_matching.rs:49 :5
7171 |
7272LL | / match Ok::<i32, i32>(42) {
7373LL | | Ok(_) => true,
@@ -76,7 +76,7 @@ LL | | };
7676 | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
7777
7878error: redundant pattern matching, consider using `is_err()`
79- --> $DIR/redundant_pattern_matching.rs:56 :5
79+ --> $DIR/redundant_pattern_matching.rs:54 :5
8080 |
8181LL | / match Ok::<i32, i32>(42) {
8282LL | | Ok(_) => false,
@@ -85,7 +85,7 @@ LL | | };
8585 | |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
8686
8787error: redundant pattern matching, consider using `is_err()`
88- --> $DIR/redundant_pattern_matching.rs:61 :5
88+ --> $DIR/redundant_pattern_matching.rs:59 :5
8989 |
9090LL | / match Err::<i32, i32>(42) {
9191LL | | Ok(_) => false,
@@ -94,7 +94,7 @@ LL | | };
9494 | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
9595
9696error: redundant pattern matching, consider using `is_ok()`
97- --> $DIR/redundant_pattern_matching.rs:66 :5
97+ --> $DIR/redundant_pattern_matching.rs:64 :5
9898 |
9999LL | / match Err::<i32, i32>(42) {
100100LL | | Ok(_) => true,
@@ -103,7 +103,7 @@ LL | | };
103103 | |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
104104
105105error: redundant pattern matching, consider using `is_some()`
106- --> $DIR/redundant_pattern_matching.rs:71 :5
106+ --> $DIR/redundant_pattern_matching.rs:69 :5
107107 |
108108LL | / match Some(42) {
109109LL | | Some(_) => true,
@@ -112,7 +112,7 @@ LL | | };
112112 | |_____^ help: try this: `Some(42).is_some()`
113113
114114error: redundant pattern matching, consider using `is_none()`
115- --> $DIR/redundant_pattern_matching.rs:76 :5
115+ --> $DIR/redundant_pattern_matching.rs:74 :5
116116 |
117117LL | / match None::<()> {
118118LL | | Some(_) => false,
@@ -121,7 +121,7 @@ LL | | };
121121 | |_____^ help: try this: `None::<()>.is_none()`
122122
123123error: redundant pattern matching, consider using `is_none()`
124- --> $DIR/redundant_pattern_matching.rs:81 :13
124+ --> $DIR/redundant_pattern_matching.rs:79 :13
125125 |
126126LL | let _ = match None::<()> {
127127 | _____________^
@@ -131,61 +131,61 @@ LL | | };
131131 | |_____^ help: try this: `None::<()>.is_none()`
132132
133133error: redundant pattern matching, consider using `is_ok()`
134- --> $DIR/redundant_pattern_matching.rs:86 :20
134+ --> $DIR/redundant_pattern_matching.rs:84 :20
135135 |
136136LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
137137 | -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
138138
139139error: redundant pattern matching, consider using `is_some()`
140- --> $DIR/redundant_pattern_matching.rs:89 :20
140+ --> $DIR/redundant_pattern_matching.rs:87 :20
141141 |
142142LL | let x = if let Some(_) = opt { true } else { false };
143143 | -------^^^^^^^------ help: try this: `if opt.is_some()`
144144
145145error: redundant pattern matching, consider using `is_some()`
146- --> $DIR/redundant_pattern_matching.rs:95 :20
146+ --> $DIR/redundant_pattern_matching.rs:93 :20
147147 |
148148LL | let _ = if let Some(_) = gen_opt() {
149149 | -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
150150
151151error: redundant pattern matching, consider using `is_none()`
152- --> $DIR/redundant_pattern_matching.rs:97 :19
152+ --> $DIR/redundant_pattern_matching.rs:95 :19
153153 |
154154LL | } else if let None = gen_opt() {
155155 | -------^^^^------------ help: try this: `if gen_opt().is_none()`
156156
157157error: redundant pattern matching, consider using `is_ok()`
158- --> $DIR/redundant_pattern_matching.rs:99 :19
158+ --> $DIR/redundant_pattern_matching.rs:97 :19
159159 |
160160LL | } else if let Ok(_) = gen_res() {
161161 | -------^^^^^------------ help: try this: `if gen_res().is_ok()`
162162
163163error: redundant pattern matching, consider using `is_err()`
164- --> $DIR/redundant_pattern_matching.rs:101 :19
164+ --> $DIR/redundant_pattern_matching.rs:99 :19
165165 |
166166LL | } else if let Err(_) = gen_res() {
167167 | -------^^^^^^------------ help: try this: `if gen_res().is_err()`
168168
169169error: redundant pattern matching, consider using `is_some()`
170- --> $DIR/redundant_pattern_matching.rs:134 :19
170+ --> $DIR/redundant_pattern_matching.rs:132 :19
171171 |
172172LL | while let Some(_) = r#try!(result_opt()) {}
173173 | ----------^^^^^^^----------------------- help: try this: `while r#try!(result_opt()).is_some()`
174174
175175error: redundant pattern matching, consider using `is_some()`
176- --> $DIR/redundant_pattern_matching.rs:135 :16
176+ --> $DIR/redundant_pattern_matching.rs:133 :16
177177 |
178178LL | if let Some(_) = r#try!(result_opt()) {}
179179 | -------^^^^^^^----------------------- help: try this: `if r#try!(result_opt()).is_some()`
180180
181181error: redundant pattern matching, consider using `is_some()`
182- --> $DIR/redundant_pattern_matching.rs:141 :12
182+ --> $DIR/redundant_pattern_matching.rs:139 :12
183183 |
184184LL | if let Some(_) = m!() {}
185185 | -------^^^^^^^------- help: try this: `if m!().is_some()`
186186
187187error: redundant pattern matching, consider using `is_some()`
188- --> $DIR/redundant_pattern_matching.rs:142 :15
188+ --> $DIR/redundant_pattern_matching.rs:140 :15
189189 |
190190LL | while let Some(_) = m!() {}
191191 | ----------^^^^^^^------- help: try this: `while m!().is_some()`
0 commit comments