11error: redundant pattern matching, consider using `is_ok()`
2- --> $DIR/redundant_pattern_matching.rs:6 :12
2+ --> $DIR/redundant_pattern_matching.rs:8 :12
33 |
44LL | if let Ok(_) = Ok::<i32, i32>(42) {}
5- | -------^^^^^------------------------ help: try this: `Ok::<i32, i32>(42).is_ok()`
5+ | -------^^^^^------------------------ help: try this: `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:8 :12
10+ --> $DIR/redundant_pattern_matching.rs:10 :12
1111 |
1212LL | if let Err(_) = Err::<i32, i32>(42) {}
13- | -------^^^^^^------------------------- help: try this: `Err::<i32, i32>(42).is_err()`
13+ | -------^^^^^^------------------------- help: try this: `Err::<i32, i32>(42).is_err(); `
1414
1515error: redundant pattern matching, consider using `is_none()`
16- --> $DIR/redundant_pattern_matching.rs:10 :12
16+ --> $DIR/redundant_pattern_matching.rs:12 :12
1717 |
1818LL | if let None = None::<()> {}
19- | -------^^^^---------------- help: try this: `None::<()>.is_none()`
19+ | -------^^^^---------------- help: try this: `None::<()>.is_none(); `
2020
2121error: redundant pattern matching, consider using `is_some()`
22- --> $DIR/redundant_pattern_matching.rs:12 :12
22+ --> $DIR/redundant_pattern_matching.rs:14 :12
2323 |
2424LL | if let Some(_) = Some(42) {}
25- | -------^^^^^^^-------------- help: try this: `Some(42).is_some()`
25+ | -------^^^^^^^-------------- help: try this: `Some(42).is_some(); `
2626
2727error: redundant pattern matching, consider using `is_ok()`
28- --> $DIR/redundant_pattern_matching.rs:26 :5
28+ --> $DIR/redundant_pattern_matching.rs:28 :5
2929 |
3030LL | / match Ok::<i32, i32>(42) {
3131LL | | Ok(_) => true,
@@ -34,7 +34,7 @@ LL | | };
3434 | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
3535
3636error: redundant pattern matching, consider using `is_err()`
37- --> $DIR/redundant_pattern_matching.rs:31 :5
37+ --> $DIR/redundant_pattern_matching.rs:33 :5
3838 |
3939LL | / match Ok::<i32, i32>(42) {
4040LL | | Ok(_) => false,
@@ -43,7 +43,7 @@ LL | | };
4343 | |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
4444
4545error: redundant pattern matching, consider using `is_err()`
46- --> $DIR/redundant_pattern_matching.rs:36 :5
46+ --> $DIR/redundant_pattern_matching.rs:38 :5
4747 |
4848LL | / match Err::<i32, i32>(42) {
4949LL | | Ok(_) => false,
@@ -52,7 +52,7 @@ LL | | };
5252 | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
5353
5454error: redundant pattern matching, consider using `is_ok()`
55- --> $DIR/redundant_pattern_matching.rs:41 :5
55+ --> $DIR/redundant_pattern_matching.rs:43 :5
5656 |
5757LL | / match Err::<i32, i32>(42) {
5858LL | | Ok(_) => true,
@@ -61,7 +61,7 @@ LL | | };
6161 | |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
6262
6363error: redundant pattern matching, consider using `is_some()`
64- --> $DIR/redundant_pattern_matching.rs:46 :5
64+ --> $DIR/redundant_pattern_matching.rs:48 :5
6565 |
6666LL | / match Some(42) {
6767LL | | Some(_) => true,
@@ -70,7 +70,7 @@ LL | | };
7070 | |_____^ help: try this: `Some(42).is_some()`
7171
7272error: redundant pattern matching, consider using `is_none()`
73- --> $DIR/redundant_pattern_matching.rs:51 :5
73+ --> $DIR/redundant_pattern_matching.rs:53 :5
7474 |
7575LL | / match None::<()> {
7676LL | | Some(_) => false,
@@ -79,7 +79,7 @@ LL | | };
7979 | |_____^ help: try this: `None::<()>.is_none()`
8080
8181error: redundant pattern matching, consider using `is_none()`
82- --> $DIR/redundant_pattern_matching.rs:56 :13
82+ --> $DIR/redundant_pattern_matching.rs:58 :13
8383 |
8484LL | let _ = match None::<()> {
8585 | _____________^
@@ -89,25 +89,19 @@ LL | | };
8989 | |_____^ help: try this: `None::<()>.is_none()`
9090
9191error: redundant pattern matching, consider using `is_ok()`
92- --> $DIR/redundant_pattern_matching.rs:61 :20
92+ --> $DIR/redundant_pattern_matching.rs:63 :20
9393 |
9494LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
9595 | -------^^^^^--------------------------------------------- help: try this: `Ok::<usize, ()>(4).is_ok()`
9696
9797error: redundant pattern matching, consider using `is_some()`
98- --> $DIR/redundant_pattern_matching.rs:67 :20
98+ --> $DIR/redundant_pattern_matching.rs:69 :20
9999 |
100100LL | let x = if let Some(_) = opt { true } else { false };
101101 | -------^^^^^^^------------------------------ help: try this: `opt.is_some()`
102102
103- error: redundant pattern matching, consider using `is_some()`
104- --> $DIR/redundant_pattern_matching.rs:69:20
105- |
106- LL | let y = if let Some(_) = opt {};
107- | -------^^^^^^^--------- help: try this: `opt.is_some()`
108-
109103error: redundant pattern matching, consider using `is_ok()`
110- --> $DIR/redundant_pattern_matching.rs:77 :12
104+ --> $DIR/redundant_pattern_matching.rs:76 :12
111105 |
112106LL | if let Ok(_) = Ok::<i32, i32>(4) {
113107 | _____- ^^^^^
@@ -118,7 +112,7 @@ LL | | }
118112 | |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
119113
120114error: redundant pattern matching, consider using `is_ok()`
121- --> $DIR/redundant_pattern_matching.rs:85 :12
115+ --> $DIR/redundant_pattern_matching.rs:84 :12
122116 |
123117LL | if let Ok(_) = Ok::<i32, i32>(4) {
124118 | _____- ^^^^^
@@ -128,5 +122,5 @@ LL | | false
128122LL | | };
129123 | |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
130124
131- error: aborting due to 16 previous errors
125+ error: aborting due to 15 previous errors
132126
0 commit comments