1
1
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2
- --> $DIR/checked_unwrap .rs:7 :9
2
+ --> $DIR/complex_conditionals .rs:8 :9
3
3
|
4
- LL | if x.is_some () {
5
- | ----------- the check is happening here
4
+ LL | if x.is_ok() && y.is_err () {
5
+ | --------- the check is happening here
6
6
LL | x.unwrap(); // unnecessary
7
7
| ^^^^^^^^^^
8
8
|
9
9
note: lint level defined here
10
- --> $DIR/checked_unwrap .rs:1:35
10
+ --> $DIR/complex_conditionals .rs:1:35
11
11
|
12
12
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
13
13
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
14
14
15
- error: This call to `unwrap()` will always panic.
16
- --> $DIR/checked_unwrap.rs:9:9
17
- |
18
- LL | if x.is_some() {
19
- | ----------- because of this check
20
- ...
21
- LL | x.unwrap(); // will panic
22
- | ^^^^^^^^^^
23
- |
24
- note: lint level defined here
25
- --> $DIR/checked_unwrap.rs:1:9
26
- |
27
- LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
28
- | ^^^^^^^^^^^^^^^^^^^^^^^^
29
-
30
- error: This call to `unwrap()` will always panic.
31
- --> $DIR/checked_unwrap.rs:12:9
32
- |
33
- LL | if x.is_none() {
34
- | ----------- because of this check
35
- LL | x.unwrap(); // will panic
36
- | ^^^^^^^^^^
37
-
38
- error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
39
- --> $DIR/checked_unwrap.rs:14:9
40
- |
41
- LL | if x.is_none() {
42
- | ----------- the check is happening here
43
- ...
44
- LL | x.unwrap(); // unnecessary
45
- | ^^^^^^^^^^
46
-
47
- error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
48
- --> $DIR/checked_unwrap.rs:18:9
49
- |
50
- LL | if x.is_ok() {
51
- | --------- the check is happening here
52
- LL | x.unwrap(); // unnecessary
53
- | ^^^^^^^^^^
54
-
55
15
error: This call to `unwrap_err()` will always panic.
56
- --> $DIR/checked_unwrap .rs:19 :9
16
+ --> $DIR/complex_conditionals .rs:9 :9
57
17
|
58
- LL | if x.is_ok() {
59
- | --------- because of this check
60
- LL | x.unwrap(); // unnecessary
61
- LL | x.unwrap_err(); // will panic
62
- | ^^^^^^^^^^^^^^
63
-
64
- error: This call to `unwrap()` will always panic.
65
- --> $DIR/checked_unwrap.rs:21:9
66
- |
67
- LL | if x.is_ok() {
18
+ LL | if x.is_ok() && y.is_err() {
68
19
| --------- because of this check
69
- ...
70
- LL | x.unwrap(); // will panic
71
- | ^^^^^^^^^^
72
-
73
- error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
74
- --> $DIR/checked_unwrap.rs:22:9
75
- |
76
- LL | if x.is_ok() {
77
- | --------- the check is happening here
78
- ...
79
- LL | x.unwrap_err(); // unnecessary
80
- | ^^^^^^^^^^^^^^
81
-
82
- error: This call to `unwrap()` will always panic.
83
- --> $DIR/checked_unwrap.rs:25:9
84
- |
85
- LL | if x.is_err() {
86
- | ---------- because of this check
87
- LL | x.unwrap(); // will panic
88
- | ^^^^^^^^^^
89
-
90
- error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
91
- --> $DIR/checked_unwrap.rs:26:9
92
- |
93
- LL | if x.is_err() {
94
- | ---------- the check is happening here
95
- LL | x.unwrap(); // will panic
96
- LL | x.unwrap_err(); // unnecessary
97
- | ^^^^^^^^^^^^^^
98
-
99
- error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
100
- --> $DIR/checked_unwrap.rs:28:9
101
- |
102
- LL | if x.is_err() {
103
- | ---------- the check is happening here
104
- ...
105
20
LL | x.unwrap(); // unnecessary
106
- | ^^^^^^^^^^
107
-
108
- error: This call to `unwrap_err()` will always panic.
109
- --> $DIR/checked_unwrap.rs:29:9
110
- |
111
- LL | if x.is_err() {
112
- | ---------- because of this check
113
- ...
114
21
LL | x.unwrap_err(); // will panic
115
22
| ^^^^^^^^^^^^^^
116
-
117
- error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
118
- --> $DIR/checked_unwrap.rs:46:9
119
23
|
120
- LL | if x.is_ok() && y.is_err() {
121
- | --------- the check is happening here
122
- LL | x.unwrap(); // unnecessary
123
- | ^^^^^^^^^^
124
-
125
- error: This call to `unwrap_err()` will always panic.
126
- --> $DIR/checked_unwrap.rs:47:9
24
+ note: lint level defined here
25
+ --> $DIR/complex_conditionals.rs:1:9
127
26
|
128
- LL | if x.is_ok() && y.is_err() {
129
- | --------- because of this check
130
- LL | x.unwrap(); // unnecessary
131
- LL | x.unwrap_err(); // will panic
132
- | ^^^^^^^^^^^^^^
27
+ LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
28
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
133
29
134
30
error: This call to `unwrap()` will always panic.
135
- --> $DIR/checked_unwrap .rs:48 :9
31
+ --> $DIR/complex_conditionals .rs:10 :9
136
32
|
137
33
LL | if x.is_ok() && y.is_err() {
138
34
| ---------- because of this check
@@ -141,7 +37,7 @@ LL | y.unwrap(); // will panic
141
37
| ^^^^^^^^^^
142
38
143
39
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
144
- --> $DIR/checked_unwrap .rs:49 :9
40
+ --> $DIR/complex_conditionals .rs:11 :9
145
41
|
146
42
LL | if x.is_ok() && y.is_err() {
147
43
| ---------- the check is happening here
@@ -150,7 +46,7 @@ LL | y.unwrap_err(); // unnecessary
150
46
| ^^^^^^^^^^^^^^
151
47
152
48
error: This call to `unwrap()` will always panic.
153
- --> $DIR/checked_unwrap .rs:63 :9
49
+ --> $DIR/complex_conditionals .rs:25 :9
154
50
|
155
51
LL | if x.is_ok() || y.is_ok() {
156
52
| --------- because of this check
@@ -159,7 +55,7 @@ LL | x.unwrap(); // will panic
159
55
| ^^^^^^^^^^
160
56
161
57
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
162
- --> $DIR/checked_unwrap .rs:64 :9
58
+ --> $DIR/complex_conditionals .rs:26 :9
163
59
|
164
60
LL | if x.is_ok() || y.is_ok() {
165
61
| --------- the check is happening here
@@ -168,7 +64,7 @@ LL | x.unwrap_err(); // unnecessary
168
64
| ^^^^^^^^^^^^^^
169
65
170
66
error: This call to `unwrap()` will always panic.
171
- --> $DIR/checked_unwrap .rs:65 :9
67
+ --> $DIR/complex_conditionals .rs:27 :9
172
68
|
173
69
LL | if x.is_ok() || y.is_ok() {
174
70
| --------- because of this check
@@ -177,7 +73,7 @@ LL | y.unwrap(); // will panic
177
73
| ^^^^^^^^^^
178
74
179
75
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
180
- --> $DIR/checked_unwrap .rs:66 :9
76
+ --> $DIR/complex_conditionals .rs:28 :9
181
77
|
182
78
LL | if x.is_ok() || y.is_ok() {
183
79
| --------- the check is happening here
@@ -186,15 +82,15 @@ LL | y.unwrap_err(); // unnecessary
186
82
| ^^^^^^^^^^^^^^
187
83
188
84
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
189
- --> $DIR/checked_unwrap .rs:70 :9
85
+ --> $DIR/complex_conditionals .rs:32 :9
190
86
|
191
87
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
192
88
| --------- the check is happening here
193
89
LL | x.unwrap(); // unnecessary
194
90
| ^^^^^^^^^^
195
91
196
92
error: This call to `unwrap_err()` will always panic.
197
- --> $DIR/checked_unwrap .rs:71 :9
93
+ --> $DIR/complex_conditionals .rs:33 :9
198
94
|
199
95
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
200
96
| --------- because of this check
@@ -203,7 +99,7 @@ LL | x.unwrap_err(); // will panic
203
99
| ^^^^^^^^^^^^^^
204
100
205
101
error: This call to `unwrap()` will always panic.
206
- --> $DIR/checked_unwrap .rs:72 :9
102
+ --> $DIR/complex_conditionals .rs:34 :9
207
103
|
208
104
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
209
105
| --------- because of this check
@@ -212,7 +108,7 @@ LL | y.unwrap(); // will panic
212
108
| ^^^^^^^^^^
213
109
214
110
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
215
- --> $DIR/checked_unwrap .rs:73 :9
111
+ --> $DIR/complex_conditionals .rs:35 :9
216
112
|
217
113
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
218
114
| --------- the check is happening here
@@ -221,7 +117,7 @@ LL | y.unwrap_err(); // unnecessary
221
117
| ^^^^^^^^^^^^^^
222
118
223
119
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
224
- --> $DIR/checked_unwrap .rs:74 :9
120
+ --> $DIR/complex_conditionals .rs:36 :9
225
121
|
226
122
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
227
123
| ---------- the check is happening here
@@ -230,7 +126,7 @@ LL | z.unwrap(); // unnecessary
230
126
| ^^^^^^^^^^
231
127
232
128
error: This call to `unwrap_err()` will always panic.
233
- --> $DIR/checked_unwrap .rs:75 :9
129
+ --> $DIR/complex_conditionals .rs:37 :9
234
130
|
235
131
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
236
132
| ---------- because of this check
@@ -239,7 +135,7 @@ LL | z.unwrap_err(); // will panic
239
135
| ^^^^^^^^^^^^^^
240
136
241
137
error: This call to `unwrap()` will always panic.
242
- --> $DIR/checked_unwrap .rs:83 :9
138
+ --> $DIR/complex_conditionals .rs:45 :9
243
139
|
244
140
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
245
141
| --------- because of this check
@@ -248,7 +144,7 @@ LL | x.unwrap(); // will panic
248
144
| ^^^^^^^^^^
249
145
250
146
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
251
- --> $DIR/checked_unwrap .rs:84 :9
147
+ --> $DIR/complex_conditionals .rs:46 :9
252
148
|
253
149
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
254
150
| --------- the check is happening here
@@ -257,7 +153,7 @@ LL | x.unwrap_err(); // unnecessary
257
153
| ^^^^^^^^^^^^^^
258
154
259
155
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
260
- --> $DIR/checked_unwrap .rs:85 :9
156
+ --> $DIR/complex_conditionals .rs:47 :9
261
157
|
262
158
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
263
159
| --------- the check is happening here
@@ -266,7 +162,7 @@ LL | y.unwrap(); // unnecessary
266
162
| ^^^^^^^^^^
267
163
268
164
error: This call to `unwrap_err()` will always panic.
269
- --> $DIR/checked_unwrap .rs:86 :9
165
+ --> $DIR/complex_conditionals .rs:48 :9
270
166
|
271
167
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
272
168
| --------- because of this check
@@ -275,7 +171,7 @@ LL | y.unwrap_err(); // will panic
275
171
| ^^^^^^^^^^^^^^
276
172
277
173
error: This call to `unwrap()` will always panic.
278
- --> $DIR/checked_unwrap .rs:87 :9
174
+ --> $DIR/complex_conditionals .rs:49 :9
279
175
|
280
176
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
281
177
| ---------- because of this check
@@ -284,7 +180,7 @@ LL | z.unwrap(); // will panic
284
180
| ^^^^^^^^^^
285
181
286
182
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
287
- --> $DIR/checked_unwrap .rs:88 :9
183
+ --> $DIR/complex_conditionals .rs:50 :9
288
184
|
289
185
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
290
186
| ---------- the check is happening here
@@ -293,21 +189,21 @@ LL | z.unwrap_err(); // unnecessary
293
189
| ^^^^^^^^^^^^^^
294
190
295
191
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
296
- --> $DIR/checked_unwrap .rs:96 :13
192
+ --> $DIR/complex_conditionals .rs:58 :13
297
193
|
298
194
LL | if x.is_some() {
299
195
| ----------- the check is happening here
300
196
LL | x.unwrap(); // unnecessary
301
197
| ^^^^^^^^^^
302
198
303
199
error: This call to `unwrap()` will always panic.
304
- --> $DIR/checked_unwrap .rs:98 :13
200
+ --> $DIR/complex_conditionals .rs:60 :13
305
201
|
306
202
LL | if x.is_some() {
307
203
| ----------- because of this check
308
204
...
309
205
LL | x.unwrap(); // will panic
310
206
| ^^^^^^^^^^
311
207
312
- error: aborting due to 34 previous errors
208
+ error: aborting due to 22 previous errors
313
209
0 commit comments