mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 08:05:12 +00:00
16 lines
346 B
Rust
16 lines
346 B
Rust
#![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
#![allow(clippy::if_same_then_else, clippy::branches_sharing_code)]
|
|
|
|
fn test_nested() {
|
|
fn nested() {
|
|
let x = Some(());
|
|
if x.is_some() {
|
|
x.unwrap(); // unnecessary
|
|
} else {
|
|
x.unwrap(); // will panic
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {}
|