1
1
error: redundant pattern matching, consider using `is_ok()`
2
- --> $DIR/redundant_pattern_matching.rs:10 :12
2
+ --> $DIR/redundant_pattern_matching.rs:8 :12
3
3
|
4
4
LL | if let Ok(_) = Ok::<i32, i32>(42) {}
5
5
| -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
6
6
|
7
7
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
8
8
9
9
error: redundant pattern matching, consider using `is_err()`
10
- --> $DIR/redundant_pattern_matching.rs:12 :12
10
+ --> $DIR/redundant_pattern_matching.rs:10 :12
11
11
|
12
12
LL | if let Err(_) = Err::<i32, i32>(42) {}
13
13
| -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
14
14
15
15
error: redundant pattern matching, consider using `is_none()`
16
- --> $DIR/redundant_pattern_matching.rs:14 :12
16
+ --> $DIR/redundant_pattern_matching.rs:12 :12
17
17
|
18
18
LL | if let None = None::<()> {}
19
19
| -------^^^^------------- help: try this: `if None::<()>.is_none()`
20
20
21
21
error: redundant pattern matching, consider using `is_some()`
22
- --> $DIR/redundant_pattern_matching.rs:16 :12
22
+ --> $DIR/redundant_pattern_matching.rs:14 :12
23
23
|
24
24
LL | if let Some(_) = Some(42) {}
25
25
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
26
26
27
27
error: redundant pattern matching, consider using `is_some()`
28
- --> $DIR/redundant_pattern_matching.rs:18 :12
28
+ --> $DIR/redundant_pattern_matching.rs:16 :12
29
29
|
30
30
LL | if let Some(_) = Some(42) {
31
31
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
32
32
33
33
error: redundant pattern matching, consider using `is_some()`
34
- --> $DIR/redundant_pattern_matching.rs:24 :15
34
+ --> $DIR/redundant_pattern_matching.rs:22 :15
35
35
|
36
36
LL | while let Some(_) = Some(42) {}
37
37
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
38
38
39
39
error: redundant pattern matching, consider using `is_none()`
40
- --> $DIR/redundant_pattern_matching.rs:26 :15
40
+ --> $DIR/redundant_pattern_matching.rs:24 :15
41
41
|
42
42
LL | while let None = Some(42) {}
43
43
| ----------^^^^----------- help: try this: `while Some(42).is_none()`
44
44
45
45
error: redundant pattern matching, consider using `is_none()`
46
- --> $DIR/redundant_pattern_matching.rs:28 :15
46
+ --> $DIR/redundant_pattern_matching.rs:26 :15
47
47
|
48
48
LL | while let None = None::<()> {}
49
49
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
50
50
51
51
error: redundant pattern matching, consider using `is_ok()`
52
- --> $DIR/redundant_pattern_matching.rs:30 :15
52
+ --> $DIR/redundant_pattern_matching.rs:28 :15
53
53
|
54
54
LL | while let Ok(_) = Ok::<i32, i32>(10) {}
55
55
| ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
56
56
57
57
error: redundant pattern matching, consider using `is_err()`
58
- --> $DIR/redundant_pattern_matching.rs:32 :15
58
+ --> $DIR/redundant_pattern_matching.rs:30 :15
59
59
|
60
60
LL | while let Err(_) = Ok::<i32, i32>(10) {}
61
61
| ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
62
62
63
63
error: redundant pattern matching, consider using `is_some()`
64
- --> $DIR/redundant_pattern_matching.rs:35 :15
64
+ --> $DIR/redundant_pattern_matching.rs:33 :15
65
65
|
66
66
LL | while let Some(_) = v.pop() {
67
67
| ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
68
68
69
69
error: redundant pattern matching, consider using `is_ok()`
70
- --> $DIR/redundant_pattern_matching.rs:51 :5
70
+ --> $DIR/redundant_pattern_matching.rs:49 :5
71
71
|
72
72
LL | / match Ok::<i32, i32>(42) {
73
73
LL | | Ok(_) => true,
@@ -76,7 +76,7 @@ LL | | };
76
76
| |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
77
77
78
78
error: redundant pattern matching, consider using `is_err()`
79
- --> $DIR/redundant_pattern_matching.rs:56 :5
79
+ --> $DIR/redundant_pattern_matching.rs:54 :5
80
80
|
81
81
LL | / match Ok::<i32, i32>(42) {
82
82
LL | | Ok(_) => false,
@@ -85,7 +85,7 @@ LL | | };
85
85
| |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
86
86
87
87
error: redundant pattern matching, consider using `is_err()`
88
- --> $DIR/redundant_pattern_matching.rs:61 :5
88
+ --> $DIR/redundant_pattern_matching.rs:59 :5
89
89
|
90
90
LL | / match Err::<i32, i32>(42) {
91
91
LL | | Ok(_) => false,
@@ -94,7 +94,7 @@ LL | | };
94
94
| |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
95
95
96
96
error: redundant pattern matching, consider using `is_ok()`
97
- --> $DIR/redundant_pattern_matching.rs:66 :5
97
+ --> $DIR/redundant_pattern_matching.rs:64 :5
98
98
|
99
99
LL | / match Err::<i32, i32>(42) {
100
100
LL | | Ok(_) => true,
@@ -103,7 +103,7 @@ LL | | };
103
103
| |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
104
104
105
105
error: redundant pattern matching, consider using `is_some()`
106
- --> $DIR/redundant_pattern_matching.rs:71 :5
106
+ --> $DIR/redundant_pattern_matching.rs:69 :5
107
107
|
108
108
LL | / match Some(42) {
109
109
LL | | Some(_) => true,
@@ -112,7 +112,7 @@ LL | | };
112
112
| |_____^ help: try this: `Some(42).is_some()`
113
113
114
114
error: redundant pattern matching, consider using `is_none()`
115
- --> $DIR/redundant_pattern_matching.rs:76 :5
115
+ --> $DIR/redundant_pattern_matching.rs:74 :5
116
116
|
117
117
LL | / match None::<()> {
118
118
LL | | Some(_) => false,
@@ -121,7 +121,7 @@ LL | | };
121
121
| |_____^ help: try this: `None::<()>.is_none()`
122
122
123
123
error: redundant pattern matching, consider using `is_none()`
124
- --> $DIR/redundant_pattern_matching.rs:81 :13
124
+ --> $DIR/redundant_pattern_matching.rs:79 :13
125
125
|
126
126
LL | let _ = match None::<()> {
127
127
| _____________^
@@ -131,61 +131,61 @@ LL | | };
131
131
| |_____^ help: try this: `None::<()>.is_none()`
132
132
133
133
error: redundant pattern matching, consider using `is_ok()`
134
- --> $DIR/redundant_pattern_matching.rs:86 :20
134
+ --> $DIR/redundant_pattern_matching.rs:84 :20
135
135
|
136
136
LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
137
137
| -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
138
138
139
139
error: redundant pattern matching, consider using `is_some()`
140
- --> $DIR/redundant_pattern_matching.rs:89 :20
140
+ --> $DIR/redundant_pattern_matching.rs:87 :20
141
141
|
142
142
LL | let x = if let Some(_) = opt { true } else { false };
143
143
| -------^^^^^^^------ help: try this: `if opt.is_some()`
144
144
145
145
error: redundant pattern matching, consider using `is_some()`
146
- --> $DIR/redundant_pattern_matching.rs:95 :20
146
+ --> $DIR/redundant_pattern_matching.rs:93 :20
147
147
|
148
148
LL | let _ = if let Some(_) = gen_opt() {
149
149
| -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
150
150
151
151
error: redundant pattern matching, consider using `is_none()`
152
- --> $DIR/redundant_pattern_matching.rs:97 :19
152
+ --> $DIR/redundant_pattern_matching.rs:95 :19
153
153
|
154
154
LL | } else if let None = gen_opt() {
155
155
| -------^^^^------------ help: try this: `if gen_opt().is_none()`
156
156
157
157
error: redundant pattern matching, consider using `is_ok()`
158
- --> $DIR/redundant_pattern_matching.rs:99 :19
158
+ --> $DIR/redundant_pattern_matching.rs:97 :19
159
159
|
160
160
LL | } else if let Ok(_) = gen_res() {
161
161
| -------^^^^^------------ help: try this: `if gen_res().is_ok()`
162
162
163
163
error: redundant pattern matching, consider using `is_err()`
164
- --> $DIR/redundant_pattern_matching.rs:101 :19
164
+ --> $DIR/redundant_pattern_matching.rs:99 :19
165
165
|
166
166
LL | } else if let Err(_) = gen_res() {
167
167
| -------^^^^^^------------ help: try this: `if gen_res().is_err()`
168
168
169
169
error: redundant pattern matching, consider using `is_some()`
170
- --> $DIR/redundant_pattern_matching.rs:134 :19
170
+ --> $DIR/redundant_pattern_matching.rs:132 :19
171
171
|
172
172
LL | while let Some(_) = r#try!(result_opt()) {}
173
173
| ----------^^^^^^^----------------------- help: try this: `while r#try!(result_opt()).is_some()`
174
174
175
175
error: redundant pattern matching, consider using `is_some()`
176
- --> $DIR/redundant_pattern_matching.rs:135 :16
176
+ --> $DIR/redundant_pattern_matching.rs:133 :16
177
177
|
178
178
LL | if let Some(_) = r#try!(result_opt()) {}
179
179
| -------^^^^^^^----------------------- help: try this: `if r#try!(result_opt()).is_some()`
180
180
181
181
error: redundant pattern matching, consider using `is_some()`
182
- --> $DIR/redundant_pattern_matching.rs:141 :12
182
+ --> $DIR/redundant_pattern_matching.rs:139 :12
183
183
|
184
184
LL | if let Some(_) = m!() {}
185
185
| -------^^^^^^^------- help: try this: `if m!().is_some()`
186
186
187
187
error: redundant pattern matching, consider using `is_some()`
188
- --> $DIR/redundant_pattern_matching.rs:142 :15
188
+ --> $DIR/redundant_pattern_matching.rs:140 :15
189
189
|
190
190
LL | while let Some(_) = m!() {}
191
191
| ----------^^^^^^^------- help: try this: `while m!().is_some()`
0 commit comments