mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-25 12:33:30 +00:00
32 lines
1.1 KiB
Text
32 lines
1.1 KiB
Text
error: called `unwrap` on `x` after checking its variant with `is_some`
|
|
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:13:13
|
|
|
|
|
LL | if x.is_some() {
|
|
| -------------- help: try: `if let Some(..) = x`
|
|
LL | // unnecessary
|
|
LL | x.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
|
note: the lint level is defined here
|
|
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:1:35
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: this call to `unwrap()` will always panic
|
|
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:17:13
|
|
|
|
|
LL | if x.is_some() {
|
|
| ----------- because of this check
|
|
...
|
|
LL | x.unwrap();
|
|
| ^^^^^^^^^^
|
|
|
|
|
note: the lint level is defined here
|
|
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:1:9
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 2 previous errors
|
|
|