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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:19:9
|
|
|
|
|
|
|
|
|
18 | if x.is_some() {
|
|
|
|
| ----------- the check is happening here
|
|
|
|
19 | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2018-06-07 22:55:11 -05:00
|
|
|
note: lint level defined here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:13:35
|
|
|
|
|
|
|
|
|
13 | #![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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:21:9
|
2018-08-01 09:30:44 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
18 | if x.is_some() {
|
2018-08-01 09:30:44 -05:00
|
|
|
| ----------- because of this check
|
2018-06-08 11:12:01 -05:00
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
21 | x.unwrap(); // will panic
|
2018-08-01 09:30:44 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2018-06-08 13:38:39 -05:00
|
|
|
note: lint level defined here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:13:9
|
2018-08-01 09:30:44 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
13 | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
2018-08-01 09:30:44 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:24:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
23 | if x.is_none() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ----------- because of this check
|
2018-10-06 11:18:06 -05:00
|
|
|
24 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:26:9
|
2018-06-07 22:55:11 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
23 | if x.is_none() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ----------- the check is happening here
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
26 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:30:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
29 | if x.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
2018-10-06 11:18:06 -05:00
|
|
|
30 | x.unwrap(); // unnecessary
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:31:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
29 | if x.is_ok() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
2018-10-06 11:18:06 -05:00
|
|
|
30 | x.unwrap(); // unnecessary
|
|
|
|
31 | x.unwrap_err(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:33:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
29 | if x.is_ok() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
33 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:34:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
29 | if x.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
34 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:37:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
36 | if x.is_err() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ---------- because of this check
|
2018-10-06 11:18:06 -05:00
|
|
|
37 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:38:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
36 | if x.is_err() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
2018-10-06 11:18:06 -05:00
|
|
|
37 | x.unwrap(); // will panic
|
|
|
|
38 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:40:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
36 | if x.is_err() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
40 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:41:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
36 | if x.is_err() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
41 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:58:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
57 | if x.is_ok() && y.is_err() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
2018-10-06 11:18:06 -05:00
|
|
|
58 | x.unwrap(); // unnecessary
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:59:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
57 | if x.is_ok() && y.is_err() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
2018-10-06 11:18:06 -05:00
|
|
|
58 | x.unwrap(); // unnecessary
|
|
|
|
59 | x.unwrap_err(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:60:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
57 | if x.is_ok() && y.is_err() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
60 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:61:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
57 | 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-10-06 11:18:06 -05:00
|
|
|
61 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:75:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
70 | if x.is_ok() || y.is_ok() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
75 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:76:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
70 | if x.is_ok() || y.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
76 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:77:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
70 | if x.is_ok() || y.is_ok() {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
77 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:78:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
70 | if x.is_ok() || y.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
78 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:82:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
81 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
2018-10-06 11:18:06 -05:00
|
|
|
82 | x.unwrap(); // unnecessary
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:83:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
81 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
2018-10-06 11:18:06 -05:00
|
|
|
82 | x.unwrap(); // unnecessary
|
|
|
|
83 | x.unwrap_err(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:84:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
81 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
84 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:85:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
81 | 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-10-06 11:18:06 -05:00
|
|
|
85 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:86:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
81 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
86 | z.unwrap(); // unnecessary
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:87:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
81 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
87 | z.unwrap_err(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:95:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
89 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
95 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:96:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
89 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
96 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:97:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
89 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
97 | y.unwrap(); // unnecessary
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:98:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
89 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
98 | y.unwrap_err(); // will panic
|
2018-06-08 11:12:01 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:99:9
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
89 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 11:12:01 -05:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
99 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:100:9
|
|
|
|
|
|
|
|
|
89 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
|
|
|
| ---------- the check is happening here
|
2018-06-07 22:55:11 -05:00
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
100 | 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-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:108:13
|
|
|
|
|
|
|
|
|
107 | if x.is_some() {
|
|
|
|
| ----------- the check is happening here
|
|
|
|
108 | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:110:13
|
2018-08-01 09:30:44 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
107 | if x.is_some() {
|
2018-08-01 09:30:44 -05:00
|
|
|
| ----------- because of this check
|
2018-06-08 11:12:01 -05:00
|
|
|
...
|
2018-10-06 11:18:06 -05:00
|
|
|
110 | x.unwrap(); // will panic
|
2018-08-01 09:30:44 -05:00
|
|
|
| ^^^^^^^^^^
|
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
|
|
|
|