From 4ef9b8d17a75d3f68951f506ad390e1367c1b2ad Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 26 Oct 2019 18:03:55 +0300 Subject: use correct spacing for enum pattern --- crates/ra_assists/src/assists/fill_match_arms.rs | 6 +++--- crates/ra_assists/src/doc_tests/generated.rs | 2 +- crates/ra_syntax/src/ast/make.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates') diff --git a/crates/ra_assists/src/assists/fill_match_arms.rs b/crates/ra_assists/src/assists/fill_match_arms.rs index 13b98d033..b6166f947 100644 --- a/crates/ra_assists/src/assists/fill_match_arms.rs +++ b/crates/ra_assists/src/assists/fill_match_arms.rs @@ -26,7 +26,7 @@ use crate::{Assist, AssistCtx, AssistId}; // // fn handle(action: Action) { // match action { -// Action::Move{ distance } => (), +// Action::Move { distance } => (), // Action::Stop => (), // } // } @@ -154,7 +154,7 @@ mod tests { A::Bs => (), A::Cs(_) => (), A::Ds(_, _) => (), - A::Es{ x, y } => (), + A::Es { x, y } => (), } } "#, @@ -207,7 +207,7 @@ mod tests { fn foo(a: &mut A) { match <|>a { - A::Es{ x, y } => (), + A::Es { x, y } => (), } } "#, diff --git a/crates/ra_assists/src/doc_tests/generated.rs b/crates/ra_assists/src/doc_tests/generated.rs index 2f36c3baa..43fa159d7 100644 --- a/crates/ra_assists/src/doc_tests/generated.rs +++ b/crates/ra_assists/src/doc_tests/generated.rs @@ -196,7 +196,7 @@ enum Action { Move { distance: u32 }, Stop } fn handle(action: Action) { match action { - Action::Move{ distance } => (), + Action::Move { distance } => (), Action::Stop => (), } } diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index 00422ea91..76dad9155 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs @@ -77,7 +77,7 @@ pub fn tuple_struct_pat( pub fn record_pat(path: ast::Path, pats: impl Iterator) -> 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)) -- cgit v1.2.3