]> git.lizzy.rs Git - rust.git/commitdiff
use correct spacing for enum pattern
authorAleksey Kladov <aleksey.kladov@gmail.com>
Sat, 26 Oct 2019 15:03:55 +0000 (18:03 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Sat, 26 Oct 2019 15:03:55 +0000 (18:03 +0300)
crates/ra_assists/src/assists/fill_match_arms.rs
crates/ra_assists/src/doc_tests/generated.rs
crates/ra_syntax/src/ast/make.rs
docs/user/assists.md

index 13b98d033359ca89dfa886a9e29c50a98340cf45..b6166f947de6facf69c63c5e6f116c7f0f4f920d 100644 (file)
@@ -26,7 +26,7 @@
 //
 // fn handle(action: Action) {
 //     match action {
-//         Action::Move{ distance } => (),
+//         Action::Move { distance } => (),
 //         Action::Stop => (),
 //     }
 // }
@@ -154,7 +154,7 @@ fn main() {
                     A::Bs => (),
                     A::Cs(_) => (),
                     A::Ds(_, _) => (),
-                    A::Es{ x, y } => (),
+                    A::Es { x, y } => (),
                 }
             }
             "#,
@@ -207,7 +207,7 @@ enum A {
 
             fn foo(a: &mut A) {
                 match <|>a {
-                    A::Es{ x, y } => (),
+                    A::Es { x, y } => (),
                 }
             }
             "#,
index 2f36c3baa31ee3e15849ad4df69596d245ff81ae..43fa159d7df7a88255b948d6f5a3e9ddd755f0fb 100644 (file)
@@ -196,7 +196,7 @@ enum Action { Move { distance: u32 }, Stop }
 
 fn handle(action: Action) {
     match action {
-        Action::Move{ distance } => (),
+        Action::Move { distance } => (),
         Action::Stop => (),
     }
 }
index 00422ea913ac12c6d147c70f2c5e2970eca7973a..76dad91557d7f80bfb98d8ba294ea79807dc8d90 100644 (file)
@@ -77,7 +77,7 @@ fn from_text(text: &str) -> ast::TupleStructPat {
 
 pub fn record_pat(path: ast::Path, pats: impl Iterator<Item = ast::Pat>) -> ast::RecordPat {
     let pats_str = pats.map(|p| p.syntax().to_string()).join(", ");
-    return from_text(&format!("{}{{ {} }}", path.syntax(), pats_str));
+    return from_text(&format!("{} {{ {} }}", path.syntax(), pats_str));
 
     fn from_text(text: &str) -> ast::RecordPat {
         ast_from_text(&format!("fn f({}: ())", text))
index 7a64c80ad599d1474884c21c9ca71b9b0b60a166..603b29c66142d2666057f41cdab908c887fdc91d 100644 (file)
@@ -191,7 +191,7 @@ enum Action { Move { distance: u32 }, Stop }
 
 fn handle(action: Action) {
     match action {
-        Action::Move{ distance } => (),
+        Action::Move { distance } => (),
         Action::Stop => (),
     }
 }