]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/checked_unwrap/complex_conditionals_nested.rs
Rollup merge of #102353 - bjorn3:allow_rustix_use_libc, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / checked_unwrap / complex_conditionals_nested.rs
1 #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
2 #![allow(clippy::if_same_then_else, clippy::branches_sharing_code)]
3
4 fn test_nested() {
5     fn nested() {
6         let x = Some(());
7         if x.is_some() {
8             x.unwrap(); // unnecessary
9         } else {
10             x.unwrap(); // will panic
11         }
12     }
13 }
14
15 fn main() {}