2020-08-10 17:27:55 -05:00
|
|
|
error: you checked before that `unwrap()` cannot fail, instead of checking and unwrapping, it's better to use `if let` or `match`
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:39:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
|
|
|
| ----------- the check is happening here
|
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2020-01-31 13:21:10 -06:00
|
|
|
note: the lint level is defined here
|
2019-07-15 14:27:44 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:1:35
|
|
|
|
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-07-23 10:06:29 -05:00
|
|
|
error: this call to `unwrap()` will always panic
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:41:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
|
|
|
| ----------- because of this check
|
|
|
|
...
|
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2020-01-31 13:21:10 -06:00
|
|
|
note: the lint level is defined here
|
2019-07-15 14:27:44 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:1:9
|
|
|
|
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-07-23 10:06:29 -05:00
|
|
|
error: this call to `unwrap()` will always panic
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:44:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_none() {
|
|
|
|
| ----------- because of this check
|
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2020-08-10 17:27:55 -05:00
|
|
|
error: you checked before that `unwrap()` cannot fail, instead of checking and unwrapping, it's better to use `if let` or `match`
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:46:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_none() {
|
|
|
|
| ----------- the check is happening here
|
|
|
|
...
|
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2020-08-10 17:27:55 -05:00
|
|
|
error: you checked before that `unwrap()` cannot fail, instead of checking and unwrapping, it's better to use `if let` or `match`
|
2020-02-04 14:38:26 -06:00
|
|
|
--> $DIR/simple_conditionals.rs:7:13
|
|
|
|
|
|
|
|
|
LL | if $a.is_some() {
|
|
|
|
| ------------ the check is happening here
|
|
|
|
LL | $a.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
...
|
|
|
|
LL | m!(x);
|
|
|
|
| ------ in this macro invocation
|
2020-02-06 21:34:06 -06:00
|
|
|
|
|
|
|
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
2020-02-04 14:38:26 -06:00
|
|
|
|
2020-08-10 17:27:55 -05:00
|
|
|
error: you checked before that `unwrap()` cannot fail, instead of checking and unwrapping, it's better to use `if let` or `match`
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:54:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_ok() {
|
|
|
|
| --------- the check is happening here
|
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2020-07-23 10:06:29 -05:00
|
|
|
error: this call to `unwrap_err()` will always panic
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:55:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_ok() {
|
|
|
|
| --------- because of this check
|
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
LL | x.unwrap_err(); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2020-07-23 10:06:29 -05:00
|
|
|
error: this call to `unwrap()` will always panic
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:57:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_ok() {
|
|
|
|
| --------- because of this check
|
|
|
|
...
|
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2020-08-10 17:27:55 -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`
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:58:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_ok() {
|
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
|
|
|
LL | x.unwrap_err(); // unnecessary
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2020-07-23 10:06:29 -05:00
|
|
|
error: this call to `unwrap()` will always panic
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:61:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_err() {
|
|
|
|
| ---------- because of this check
|
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2020-08-10 17:27:55 -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`
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:62:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_err() {
|
|
|
|
| ---------- the check is happening here
|
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
LL | x.unwrap_err(); // unnecessary
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2020-08-10 17:27:55 -05:00
|
|
|
error: you checked before that `unwrap()` cannot fail, instead of checking and unwrapping, it's better to use `if let` or `match`
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:64:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_err() {
|
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2020-07-23 10:06:29 -05:00
|
|
|
error: this call to `unwrap_err()` will always panic
|
2020-04-24 09:46:56 -05:00
|
|
|
--> $DIR/simple_conditionals.rs:65:9
|
2019-07-15 14:27:44 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_err() {
|
|
|
|
| ---------- because of this check
|
|
|
|
...
|
|
|
|
LL | x.unwrap_err(); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2020-02-04 14:38:26 -06:00
|
|
|
error: aborting due to 13 previous errors
|
2019-07-15 14:27:44 -05:00
|
|
|
|