2021-09-08 09:31:47 -05:00
|
|
|
error: called `unwrap` on `x` after checking its variant with `is_some`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:13:13
|
2020-03-18 09:24:48 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
2024-08-24 16:34:45 -05:00
|
|
|
| -------------- help: try: `if let Some(<item>) = x`
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | // unnecessary
|
|
|
|
LL | x.unwrap();
|
2020-03-18 09:24:48 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:1:35
|
2020-03-18 09:24:48 -05:00
|
|
|
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-08-11 08:43:21 -05:00
|
|
|
error: this call to `unwrap()` will always panic
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:17:13
|
2020-03-18 09:24:48 -05:00
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
|
|
|
| ----------- because of this check
|
|
|
|
...
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | x.unwrap();
|
2020-03-18 09:24:48 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:1:9
|
2020-03-18 09:24:48 -05:00
|
|
|
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|