]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/blocks_in_if_conditions_closure.rs
`assertions_on_result_states` fix suggestion when `assert!` not in a statement
[rust.git] / tests / ui / blocks_in_if_conditions_closure.rs
index acbabfa20d737495708db8f9cc1380a24e9349c5..169589f6d4e7006044976d31c1d32085071ad9d1 100644 (file)
@@ -44,4 +44,21 @@ fn macro_in_closure() {
     }
 }
 
-fn main() {}
+fn closure(_: impl FnMut()) -> bool {
+    true
+}
+
+fn function_with_empty_closure() {
+    if closure(|| {}) {}
+}
+
+#[rustfmt::skip]
+fn main() {
+    let mut range = 0..10;
+    range.all(|i| {i < 10} );
+
+    let v = vec![1, 2, 3];
+    if v.into_iter().any(|x| {x == 4}) {
+        println!("contains 4!");
+    }
+}