From 12e3b4c70b5ef23b2fdfc197296d483680e125f9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 8 Feb 2019 14:49:43 +0300 Subject: reformat the world --- crates/ra_syntax/src/grammar/expressions.rs | 15 +++------------ crates/ra_syntax/src/grammar/expressions/atom.rs | 9 +-------- crates/ra_syntax/src/grammar/items.rs | 6 +----- crates/ra_syntax/src/grammar/params.rs | 6 +----- crates/ra_syntax/src/grammar/patterns.rs | 4 +--- 5 files changed, 7 insertions(+), 33 deletions(-) (limited to 'crates/ra_syntax/src/grammar') diff --git a/crates/ra_syntax/src/grammar/expressions.rs b/crates/ra_syntax/src/grammar/expressions.rs index 6b88c5685..28fcb1f7d 100644 --- a/crates/ra_syntax/src/grammar/expressions.rs +++ b/crates/ra_syntax/src/grammar/expressions.rs @@ -7,26 +7,17 @@ use super::*; const EXPR_FIRST: TokenSet = LHS_FIRST; pub(super) fn expr(p: &mut Parser) -> BlockLike { - let r = Restrictions { - forbid_structs: false, - prefer_stmt: false, - }; + let r = Restrictions { forbid_structs: false, prefer_stmt: false }; expr_bp(p, r, 1) } pub(super) fn expr_stmt(p: &mut Parser) -> BlockLike { - let r = Restrictions { - forbid_structs: false, - prefer_stmt: true, - }; + let r = Restrictions { forbid_structs: false, prefer_stmt: true }; expr_bp(p, r, 1) } fn expr_no_struct(p: &mut Parser) { - let r = Restrictions { - forbid_structs: true, - prefer_stmt: false, - }; + let r = Restrictions { forbid_structs: true, prefer_stmt: false }; expr_bp(p, r, 1); } diff --git a/crates/ra_syntax/src/grammar/expressions/atom.rs b/crates/ra_syntax/src/grammar/expressions/atom.rs index 600774afd..27ba87657 100644 --- a/crates/ra_syntax/src/grammar/expressions/atom.rs +++ b/crates/ra_syntax/src/grammar/expressions/atom.rs @@ -141,14 +141,7 @@ fn tuple_expr(p: &mut Parser) -> CompletedMarker { } } p.expect(R_PAREN); - m.complete( - p, - if saw_expr && !saw_comma { - PAREN_EXPR - } else { - TUPLE_EXPR - }, - ) + m.complete(p, if saw_expr && !saw_comma { PAREN_EXPR } else { TUPLE_EXPR }) } // test array_expr diff --git a/crates/ra_syntax/src/grammar/items.rs b/crates/ra_syntax/src/grammar/items.rs index 84c18a293..a61f260cf 100644 --- a/crates/ra_syntax/src/grammar/items.rs +++ b/crates/ra_syntax/src/grammar/items.rs @@ -155,11 +155,7 @@ pub(super) fn maybe_item(p: &mut Parser, flavor: ItemFlavor) -> MaybeItem { IMPL_BLOCK } _ => { - return if has_mods { - MaybeItem::Modifiers - } else { - MaybeItem::None - }; + return if has_mods { MaybeItem::Modifiers } else { MaybeItem::None }; } }; diff --git a/crates/ra_syntax/src/grammar/params.rs b/crates/ra_syntax/src/grammar/params.rs index 13158429a..185386569 100644 --- a/crates/ra_syntax/src/grammar/params.rs +++ b/crates/ra_syntax/src/grammar/params.rs @@ -36,11 +36,7 @@ impl Flavor { } fn list_(p: &mut Parser, flavor: Flavor) { - let (bra, ket) = if flavor.type_required() { - (L_PAREN, R_PAREN) - } else { - (PIPE, PIPE) - }; + let (bra, ket) = if flavor.type_required() { (L_PAREN, R_PAREN) } else { (PIPE, PIPE) }; assert!(p.at(bra)); let m = p.start(); p.bump(); diff --git a/crates/ra_syntax/src/grammar/patterns.rs b/crates/ra_syntax/src/grammar/patterns.rs index 1ac5efdf6..f3f400ae0 100644 --- a/crates/ra_syntax/src/grammar/patterns.rs +++ b/crates/ra_syntax/src/grammar/patterns.rs @@ -2,9 +2,7 @@ use super::*; pub(super) const PATTERN_FIRST: TokenSet = expressions::LITERAL_FIRST .union(paths::PATH_FIRST) - .union(token_set![ - REF_KW, MUT_KW, L_PAREN, L_BRACK, AMP, UNDERSCORE - ]); + .union(token_set![REF_KW, MUT_KW, L_PAREN, L_BRACK, AMP, UNDERSCORE]); pub(super) fn pattern(p: &mut Parser) { pattern_r(p, PAT_RECOVERY_SET) -- cgit v1.2.3