From d8649c1af86118dea6b6340c999b5864a8d55279 Mon Sep 17 00:00:00 2001 From: kjeremy Date: Fri, 26 Apr 2019 11:42:56 -0400 Subject: Simplify --- crates/ra_parser/src/grammar/expressions.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_parser/src/grammar') diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index 8df9035e9..9fe529f53 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs @@ -252,12 +252,12 @@ fn expr_bp( // `newly_dollar_open` is a flag indicated that dollar is just closed after lhs, e.g. // `$1$ + a` // We use this flag to skip handling it. - let mut newly_dollar_open = false; - - if p.at_l_dollar() { + let mut newly_dollar_open = if p.at_l_dollar() { *dollar_lvl += p.eat_l_dollars(); - newly_dollar_open = true; - } + true + } else { + false + }; let mut lhs = match lhs(p, r, dollar_lvl) { Some((lhs, blocklike)) => { @@ -535,7 +535,7 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) { } EXCL => { let block_like = items::macro_call_after_excl(p); - return (m.complete(p, MACRO_CALL), block_like); + (m.complete(p, MACRO_CALL), block_like) } _ => (m.complete(p, PATH_EXPR), BlockLike::NotBlock), } -- cgit v1.2.3