2018-05-27 22:02:38 +00:00
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:7:9
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_some() {
|
2018-10-06 16:18:06 +00:00
|
|
|
| ----------- the check is happening here
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // unnecessary
|
2018-10-06 16:18:06 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2018-06-08 03:55:11 +00:00
|
|
|
note: lint level defined here
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:1:35
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
2018-10-06 16:18:06 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-05-27 22:02:38 +00:00
|
|
|
|
2018-06-08 16:12:01 +00:00
|
|
|
error: This call to `unwrap()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:9:9
|
2018-08-01 14:30:44 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_some() {
|
2018-08-01 14:30:44 +00:00
|
|
|
| ----------- because of this check
|
2018-06-08 16:12:01 +00:00
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // will panic
|
2018-08-01 14:30:44 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2018-06-08 18:38:39 +00:00
|
|
|
note: lint level defined here
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:1:9
|
2018-08-01 14:30:44 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
2018-08-01 14:30:44 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:12:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_none() {
|
2018-06-08 16:12:01 +00:00
|
|
|
| ----------- because of this check
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // will panic
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 22:02:38 +00:00
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:14:9
|
2018-06-08 03:55:11 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_none() {
|
2018-06-08 03:55:11 +00:00
|
|
|
| ----------- the check is happening here
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // unnecessary
|
2018-06-08 03:55:11 +00:00
|
|
|
| ^^^^^^^^^^
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:18:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() {
|
2018-06-08 03:55:11 +00:00
|
|
|
| --------- the check is happening here
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // unnecessary
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:19:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() {
|
2018-06-08 16:12:01 +00:00
|
|
|
| --------- because of this check
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
LL | x.unwrap_err(); // will panic
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:21:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() {
|
2018-06-08 16:12:01 +00:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // will panic
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:22:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() {
|
2018-06-08 03:55:11 +00:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap_err(); // unnecessary
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-06-08 16:12:01 +00:00
|
|
|
error: This call to `unwrap()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:25:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_err() {
|
2018-06-08 16:12:01 +00:00
|
|
|
| ---------- because of this check
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // will panic
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 22:02:38 +00:00
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:26:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_err() {
|
2018-06-08 03:55:11 +00:00
|
|
|
| ---------- the check is happening here
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
LL | x.unwrap_err(); // unnecessary
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:28:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_err() {
|
2018-06-08 03:55:11 +00:00
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // unnecessary
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-06-08 16:12:01 +00:00
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:29:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_err() {
|
2018-06-08 16:12:01 +00:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap_err(); // will panic
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-05-27 22:02:38 +00:00
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:46:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() && y.is_err() {
|
2018-06-08 03:55:11 +00:00
|
|
|
| --------- the check is happening here
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // unnecessary
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:47:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() && y.is_err() {
|
2018-06-08 16:12:01 +00:00
|
|
|
| --------- because of this check
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
LL | x.unwrap_err(); // will panic
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:48:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() && y.is_err() {
|
2018-06-08 16:12:01 +00:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | y.unwrap(); // will panic
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:49:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() && y.is_err() {
|
2018-06-08 03:55:11 +00:00
|
|
|
| ---------- the check is happening here
|
2018-06-08 16:12:01 +00:00
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | y.unwrap_err(); // unnecessary
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-06-08 16:12:01 +00:00
|
|
|
error: This call to `unwrap()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:63:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
2018-06-08 16:12:01 +00:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // will panic
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 22:02:38 +00:00
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:64:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
2018-06-08 03:55:11 +00:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap_err(); // unnecessary
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-06-08 16:12:01 +00:00
|
|
|
error: This call to `unwrap()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:65:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
2018-06-08 16:12:01 +00:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | y.unwrap(); // will panic
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 22:02:38 +00:00
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:66:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
2018-06-08 03:55:11 +00:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | y.unwrap_err(); // unnecessary
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:70:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 03:55:11 +00:00
|
|
|
| --------- the check is happening here
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // unnecessary
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:71:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 16:12:01 +00:00
|
|
|
| --------- because of this check
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
LL | x.unwrap_err(); // will panic
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:72:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 16:12:01 +00:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | y.unwrap(); // will panic
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:73:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 03:55:11 +00:00
|
|
|
| --------- the check is happening here
|
2018-06-08 16:12:01 +00:00
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | y.unwrap_err(); // unnecessary
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:74:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 03:55:11 +00:00
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | z.unwrap(); // unnecessary
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:75:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 16:12:01 +00:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | z.unwrap_err(); // will panic
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:83:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 16:12:01 +00:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // will panic
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:84:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 03:55:11 +00:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap_err(); // unnecessary
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:85:9
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 03:55:11 +00:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | y.unwrap(); // unnecessary
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:86:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 16:12:01 +00:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | y.unwrap_err(); // will panic
|
2018-06-08 16:12:01 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:87:9
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 16:12:01 +00:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | z.unwrap(); // will panic
|
2018-05-27 22:02:38 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:88:9
|
2018-12-10 05:27:19 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-12-10 05:27:19 +00:00
|
|
|
| ---------- the check is happening here
|
2018-06-08 03:55:11 +00:00
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | z.unwrap_err(); // unnecessary
|
2018-12-10 05:27:19 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
2018-05-27 22:02:38 +00:00
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:96:13
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
|
|
|
| ----------- the check is happening here
|
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
2018-06-08 16:12:01 +00:00
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
2019-01-07 21:33:18 +00:00
|
|
|
--> $DIR/checked_unwrap.rs:98:13
|
2018-12-27 15:57:55 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
|
|
|
| ----------- because of this check
|
2018-06-08 16:12:01 +00:00
|
|
|
...
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
2018-05-27 22:02:38 +00:00
|
|
|
|
2018-06-08 16:12:01 +00:00
|
|
|
error: aborting due to 34 previous errors
|
2018-05-27 22:02:38 +00:00
|
|
|
|