rust-clippy/tests/ui/checked_unwrap/complex_conditionals_nested.rs
2020-03-18 15:26:24 +01:00

15 lines
315 B
Rust

#![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
#![allow(clippy::if_same_then_else)]
fn test_nested() {
fn nested() {
let x = Some(());
if x.is_some() {
x.unwrap(); // unnecessary
} else {
x.unwrap(); // will panic
}
}
}
fn main() {}