]> git.lizzy.rs Git - rust.git/blobdiff - tests/source/single-line-if-else.rs
Prevent duplicate comma when formatting struct pattern with ".."
[rust.git] / tests / source / single-line-if-else.rs
index 25ba58cabf884bae077ee94d10674ceec2dfb31d..bcde390d1164dd55abad76f2ff15f5e1ada76ef9 100644 (file)
@@ -1,4 +1,3 @@
-// rustfmt-single_line_if_else: true
 
 // Format if-else expressions on a single line, when possible.
 
@@ -26,13 +25,17 @@ fn main() {
         10
     };
 
+    let d   = if  let  Some(val)  =  turbo 
+    { "cool" } else {
+     "beans" };
+
     if cond() { statement(); } else { other_statement(); }
 
     if true  {
         do_something()
     }
 
-    let x = if veeeeeeeeery_loooooong_condition() { aaaaaaaaaaaaaaaaaaaaaaaaaaa } else { bbbbbbbbbb };
+    let x = if veeeeeeeeery_loooooong_condition() { aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa } else { bbbbbbbbbb };
   
     let x = if veeeeeeeeery_loooooong_condition()     {    aaaaaaaaaaaaaaaaaaaaaaaaa }   else  {
         bbbbbbbbbb };