2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:9:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
8 | if x.is_some() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ----------- the check is happening here
|
2018-08-01 09:30:44 -05:00
|
|
|
9 | x.unwrap(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2018-06-07 22:55:11 -05:00
|
|
|
note: lint level defined here
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:3:35
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
3 | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-05-27 17:02:38 -05:00
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:11:9
|
|
|
|
|
|
|
|
|
8 | if x.is_some() {
|
|
|
|
| ----------- because of this check
|
2018-06-08 11:12:01 -05:00
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
11 | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2018-06-08 13:38:39 -05:00
|
|
|
note: lint level defined here
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:3:9
|
|
|
|
|
|
|
|
|
3 | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:14:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
13 | if x.is_none() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ----------- because of this check
|
2018-08-01 09:30:44 -05:00
|
|
|
14 | x.unwrap(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:16:9
|
2018-06-07 22:55:11 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
13 | if x.is_none() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ----------- the check is happening here
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
16 | x.unwrap(); // unnecessary
|
2018-06-07 22:55:11 -05:00
|
|
|
| ^^^^^^^^^^
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:20:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
19 | if x.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
2018-08-01 09:30:44 -05:00
|
|
|
20 | x.unwrap(); // unnecessary
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:21:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
19 | if x.is_ok() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
2018-08-01 09:30:44 -05:00
|
|
|
20 | x.unwrap(); // unnecessary
|
|
|
|
21 | x.unwrap_err(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:23:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
19 | if x.is_ok() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
23 | x.unwrap(); // will panic
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:24:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
19 | if x.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
24 | x.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:27:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
26 | if x.is_err() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ---------- because of this check
|
2018-08-01 09:30:44 -05:00
|
|
|
27 | x.unwrap(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:28:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
26 | if x.is_err() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
2018-08-01 09:30:44 -05:00
|
|
|
27 | x.unwrap(); // will panic
|
|
|
|
28 | x.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:30:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
26 | if x.is_err() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
30 | x.unwrap(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:31:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
26 | if x.is_err() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
31 | x.unwrap_err(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:48:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
47 | if x.is_ok() && y.is_err() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
2018-08-01 09:30:44 -05:00
|
|
|
48 | x.unwrap(); // unnecessary
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:49:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
47 | if x.is_ok() && y.is_err() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
2018-08-01 09:30:44 -05:00
|
|
|
48 | x.unwrap(); // unnecessary
|
|
|
|
49 | x.unwrap_err(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:50:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
47 | if x.is_ok() && y.is_err() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
50 | y.unwrap(); // will panic
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:51:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
47 | if x.is_ok() && y.is_err() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
2018-06-08 11:12:01 -05:00
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
51 | y.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:65:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
60 | if x.is_ok() || y.is_ok() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
65 | x.unwrap(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:66:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
60 | if x.is_ok() || y.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
66 | x.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:67:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
60 | if x.is_ok() || y.is_ok() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
67 | y.unwrap(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:68:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
60 | if x.is_ok() || y.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
68 | y.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:72:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
2018-08-01 09:30:44 -05:00
|
|
|
72 | x.unwrap(); // unnecessary
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:73:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
2018-08-01 09:30:44 -05:00
|
|
|
72 | x.unwrap(); // unnecessary
|
|
|
|
73 | x.unwrap_err(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:74:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
74 | y.unwrap(); // will panic
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:75:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
2018-06-08 11:12:01 -05:00
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
75 | y.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:76:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
76 | z.unwrap(); // unnecessary
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:77:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
71 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
77 | z.unwrap_err(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:85:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
85 | x.unwrap(); // will panic
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:86:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
86 | x.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:87:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
87 | y.unwrap(); // unnecessary
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:88:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
88 | y.unwrap_err(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:89:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
89 | z.unwrap(); // will panic
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:90:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
79 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
90 | z.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:98:13
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
97 | if x.is_some() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ----------- the check is happening here
|
2018-08-01 09:30:44 -05:00
|
|
|
98 | x.unwrap(); // unnecessary
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-08-01 09:30:44 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:100:13
|
|
|
|
|
|
|
|
|
97 | if x.is_some() {
|
|
|
|
| ----------- because of this check
|
2018-06-08 11:12:01 -05:00
|
|
|
...
|
2018-08-01 09:30:44 -05:00
|
|
|
100 | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
2018-05-27 17:02:38 -05:00
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: aborting due to 34 previous errors
|
2018-05-27 17:02:38 -05:00
|
|
|
|