]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/blocks_in_if_conditions.fixed
Add version = "Two" to rustfmt.toml
[rust.git] / tests / ui / blocks_in_if_conditions.fixed
index 14562c4d32c12996c3b56073ed602e0ed7dd0ba3..e6e40a9948c91880affcb75cc99c6d8f25627624 100644 (file)
@@ -4,9 +4,7 @@
 #![warn(clippy::nonminimal_bool)]
 
 macro_rules! blocky {
-    () => {{
-        true
-    }};
+    () => {{ true }};
 }
 
 macro_rules! blocky_too {
@@ -34,20 +32,12 @@ fn condition_has_block() -> i32 {
 }
 
 fn condition_has_block_with_single_expression() -> i32 {
-    if true {
-        6
-    } else {
-        10
-    }
+    if true { 6 } else { 10 }
 }
 
 fn condition_is_normal() -> i32 {
     let x = 3;
-    if x == 3 {
-        6
-    } else {
-        10
-    }
+    if x == 3 { 6 } else { 10 }
 }
 
 fn condition_is_unsafe_block() {
@@ -61,14 +51,15 @@ fn condition_is_unsafe_block() {
 
 fn block_in_assert() {
     let opt = Some(42);
-    assert!(opt
-        .as_ref()
-        .map(|val| {
-            let mut v = val * 2;
-            v -= 1;
-            v * 3
-        })
-        .is_some());
+    assert!(
+        opt.as_ref()
+            .map(|val| {
+                let mut v = val * 2;
+                v -= 1;
+                v * 3
+            })
+            .is_some()
+    );
 }
 
 fn main() {}