]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/manual_flatten.rs
Rollup merge of #102581 - jyn514:src-detection, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / manual_flatten.rs
index 6c5232ec5f55b7d0e59dec9373f55b4f91cd0f16..96cd87c0e19a7079f0940975ebd69241f19dd5b8 100644 (file)
@@ -1,5 +1,5 @@
 #![warn(clippy::manual_flatten)]
-#![allow(clippy::useless_vec)]
+#![allow(clippy::useless_vec, clippy::uninlined_format_args)]
 
 fn main() {
     // Test for loop over implicitly adjusted `Iterator` with `if let` expression
@@ -106,4 +106,20 @@ struct Test {
     for n in vec![Some(1), Some(2), Some(3)].iter().flatten() {
         println!("{}", n);
     }
+
+    run_unformatted_tests();
+}
+
+#[rustfmt::skip]
+fn run_unformatted_tests() {
+    // Skip rustfmt here on purpose so the suggestion does not fit in one line
+    for n in vec![
+        Some(1),
+        Some(2),
+        Some(3)
+    ].iter() {
+        if let Some(n) = n {
+            println!("{:?}", n);
+        }
+    }
 }