]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/checked_unwrap/complex_conditionals.rs
A new lint for shared code in if blocks
[rust.git] / tests / ui / checked_unwrap / complex_conditionals.rs
index fbeee1b572a6c818cbd35a450b1f110b75f920fe..bb5b6f5ec04361165ecb85f52934c68f71b534a6 100644 (file)
@@ -1,5 +1,5 @@
 #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
-#![allow(clippy::if_same_then_else)]
+#![allow(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)]
 
 fn test_complex_conditions() {
     let x: Result<(), ()> = Ok(());
@@ -51,15 +51,4 @@ fn test_complex_conditions() {
     }
 }
 
-fn test_nested() {
-    fn nested() {
-        let x = Some(());
-        if x.is_some() {
-            x.unwrap(); // unnecessary
-        } else {
-            x.unwrap(); // will panic
-        }
-    }
-}
-
 fn main() {}