2021-09-08 09:31:47 -05:00
|
|
|
error: called `unwrap` on `x` after checking its variant with `is_some`
|
2020-03-18 09:24:48 -05:00
|
|
|
--> $DIR/complex_conditionals_nested.rs:8:13
|
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
2021-09-08 09:31:47 -05:00
|
|
|
| -------------- help: try: `if let Some(..) = x`
|
2020-03-18 09:24:48 -05:00
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
|
|
|
--> $DIR/complex_conditionals_nested.rs:1:35
|
|
|
|
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-08-11 08:43:21 -05:00
|
|
|
error: this call to `unwrap()` will always panic
|
2020-03-18 09:24:48 -05:00
|
|
|
--> $DIR/complex_conditionals_nested.rs:10:13
|
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
|
|
|
| ----------- because of this check
|
|
|
|
...
|
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
|
|
|
--> $DIR/complex_conditionals_nested.rs:1:9
|
|
|
|
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|