From 4ef9b8d17a75d3f68951f506ad390e1367c1b2ad Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 26 Oct 2019 18:03:55 +0300 Subject: [PATCH] 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 +- docs/user/assists.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/ra_assists/src/assists/fill_match_arms.rs b/crates/ra_assists/src/assists/fill_match_arms.rs index 13b98d0333..b6166f947d 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 2f36c3baa3..43fa159d7d 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 00422ea913..76dad91557 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)) diff --git a/docs/user/assists.md b/docs/user/assists.md index 7a64c80ad5..603b29c661 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md @@ -191,7 +191,7 @@ enum Action { Move { distance: u32 }, Stop } fn handle(action: Action) { match action { - Action::Move{ distance } => (), + Action::Move { distance } => (), Action::Stop => (), } }