@@ -2,30 +2,72 @@ error: redundant pattern matching, consider using `is_ok()`
22 --> $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: `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()`
1010 --> $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: `if Err::<i32, i32>(42).is_err()`
1414
1515error: redundant pattern matching, consider using `is_none()`
1616 --> $DIR/redundant_pattern_matching.rs:12:12
1717 |
1818LL | if let None = None::<()> {}
19- | -------^^^^---------------- help: try this: `None::<()>.is_none(); `
19+ | -------^^^^------------- help: try this: `if None::<()>.is_none()`
2020
2121error: redundant pattern matching, consider using `is_some()`
2222 --> $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: `if Some(42).is_some()`
26+
27+ error: redundant pattern matching, consider using `is_some()`
28+ --> $DIR/redundant_pattern_matching.rs:16:12
29+ |
30+ LL | if let Some(_) = Some(42) {
31+ | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
32+
33+ error: redundant pattern matching, consider using `is_some()`
34+ --> $DIR/redundant_pattern_matching.rs:22:15
35+ |
36+ LL | while let Some(_) = Some(42) {}
37+ | ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
38+
39+ error: redundant pattern matching, consider using `is_none()`
40+ --> $DIR/redundant_pattern_matching.rs:24:15
41+ |
42+ LL | while let None = Some(42) {}
43+ | ----------^^^^----------- help: try this: `while Some(42).is_none()`
44+
45+ error: redundant pattern matching, consider using `is_none()`
46+ --> $DIR/redundant_pattern_matching.rs:26:15
47+ |
48+ LL | while let None = None::<()> {}
49+ | ----------^^^^------------- help: try this: `while None::<()>.is_none()`
2650
2751error: redundant pattern matching, consider using `is_ok()`
28- --> $DIR/redundant_pattern_matching.rs:28:5
52+ --> $DIR/redundant_pattern_matching.rs:28:15
53+ |
54+ LL | while let Ok(_) = Ok::<i32, i32>(10) {}
55+ | ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
56+
57+ error: redundant pattern matching, consider using `is_err()`
58+ --> $DIR/redundant_pattern_matching.rs:30:15
59+ |
60+ LL | while let Err(_) = Ok::<i32, i32>(10) {}
61+ | ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
62+
63+ error: redundant pattern matching, consider using `is_some()`
64+ --> $DIR/redundant_pattern_matching.rs:33:15
65+ |
66+ LL | while let Some(_) = v.pop() {
67+ | ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
68+
69+ error: redundant pattern matching, consider using `is_ok()`
70+ --> $DIR/redundant_pattern_matching.rs:49:5
2971 |
3072LL | / match Ok::<i32, i32>(42) {
3173LL | | Ok(_) => true,
@@ -34,7 +76,7 @@ LL | | };
3476 | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
3577
3678error: redundant pattern matching, consider using `is_err()`
37- --> $DIR/redundant_pattern_matching.rs:33 :5
79+ --> $DIR/redundant_pattern_matching.rs:54 :5
3880 |
3981LL | / match Ok::<i32, i32>(42) {
4082LL | | Ok(_) => false,
@@ -43,7 +85,7 @@ LL | | };
4385 | |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
4486
4587error: redundant pattern matching, consider using `is_err()`
46- --> $DIR/redundant_pattern_matching.rs:38 :5
88+ --> $DIR/redundant_pattern_matching.rs:59 :5
4789 |
4890LL | / match Err::<i32, i32>(42) {
4991LL | | Ok(_) => false,
@@ -52,7 +94,7 @@ LL | | };
5294 | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
5395
5496error: redundant pattern matching, consider using `is_ok()`
55- --> $DIR/redundant_pattern_matching.rs:43 :5
97+ --> $DIR/redundant_pattern_matching.rs:64 :5
5698 |
5799LL | / match Err::<i32, i32>(42) {
58100LL | | Ok(_) => true,
@@ -61,7 +103,7 @@ LL | | };
61103 | |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
62104
63105error: redundant pattern matching, consider using `is_some()`
64- --> $DIR/redundant_pattern_matching.rs:48 :5
106+ --> $DIR/redundant_pattern_matching.rs:69 :5
65107 |
66108LL | / match Some(42) {
67109LL | | Some(_) => true,
@@ -70,7 +112,7 @@ LL | | };
70112 | |_____^ help: try this: `Some(42).is_some()`
71113
72114error: redundant pattern matching, consider using `is_none()`
73- --> $DIR/redundant_pattern_matching.rs:53 :5
115+ --> $DIR/redundant_pattern_matching.rs:74 :5
74116 |
75117LL | / match None::<()> {
76118LL | | Some(_) => false,
@@ -79,7 +121,7 @@ LL | | };
79121 | |_____^ help: try this: `None::<()>.is_none()`
80122
81123error: redundant pattern matching, consider using `is_none()`
82- --> $DIR/redundant_pattern_matching.rs:58 :13
124+ --> $DIR/redundant_pattern_matching.rs:79 :13
83125 |
84126LL | let _ = match None::<()> {
85127 | _____________^
@@ -89,38 +131,28 @@ LL | | };
89131 | |_____^ help: try this: `None::<()>.is_none()`
90132
91133error: redundant pattern matching, consider using `is_ok()`
92- --> $DIR/redundant_pattern_matching.rs:63 :20
134+ --> $DIR/redundant_pattern_matching.rs:84 :20
93135 |
94136LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
95- | -------^^^^^--------------------------------------------- help: try this: `Ok::<usize, ()>(4).is_ok()`
137+ | -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
96138
97139error: redundant pattern matching, consider using `is_some()`
98- --> $DIR/redundant_pattern_matching.rs:69 :20
140+ --> $DIR/redundant_pattern_matching.rs:90 :20
99141 |
100142LL | let x = if let Some(_) = opt { true } else { false };
101- | -------^^^^^^^------------------------------ help: try this: `opt.is_some()`
143+ | -------^^^^^^^------ help: try this: `if opt.is_some()`
102144
103145error: redundant pattern matching, consider using `is_ok()`
104- --> $DIR/redundant_pattern_matching.rs:76 :12
146+ --> $DIR/redundant_pattern_matching.rs:101 :12
105147 |
106- LL | if let Ok(_) = Ok::<i32, i32>(4) {
107- | _____- ^^^^^
108- LL | | true
109- LL | | } else {
110- LL | | false
111- LL | | }
112- | |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
148+ LL | if let Ok(_) = Ok::<i32, i32>(4) {
149+ | -------^^^^^-------------------- help: try this: `if Ok::<i32, i32>(4).is_ok()`
113150
114151error: redundant pattern matching, consider using `is_ok()`
115- --> $DIR/redundant_pattern_matching.rs:84 :12
152+ --> $DIR/redundant_pattern_matching.rs:109 :12
116153 |
117- LL | if let Ok(_) = Ok::<i32, i32>(4) {
118- | _____- ^^^^^
119- LL | | true
120- LL | | } else {
121- LL | | false
122- LL | | };
123- | |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
154+ LL | if let Ok(_) = Ok::<i32, i32>(4) {
155+ | -------^^^^^-------------------- help: try this: `if Ok::<i32, i32>(4).is_ok()`
124156
125- error: aborting due to 15 previous errors
157+ error: aborting due to 22 previous errors
126158
0 commit comments