rust-clippy/tests/ui/checked_unwrap/complex_conditionals_nested.rs
2023-08-11 14:02:28 +00:00

19 lines
409 B
Rust

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