From cd8e33fb7e60d78809da5e77c968ef30433c2317 Mon Sep 17 00:00:00 2001 From: DJMcNab <36049421+DJMcNab@users.noreply.github.com> Date: Wed, 19 Dec 2018 18:33:36 +0000 Subject: Revert to f6f7c5 --- crates/ra_syntax/src/grammar/expressions/atom.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'crates/ra_syntax/src/grammar/expressions') diff --git a/crates/ra_syntax/src/grammar/expressions/atom.rs b/crates/ra_syntax/src/grammar/expressions/atom.rs index e86a33090..04087fd60 100644 --- a/crates/ra_syntax/src/grammar/expressions/atom.rs +++ b/crates/ra_syntax/src/grammar/expressions/atom.rs @@ -61,16 +61,12 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet = token_set_union![ const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW]; -pub(super) fn atom_expr( - p: &mut Parser, - r: Restrictions, -) -> (Option, Option) { +pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option { if let Some(m) = literal(p) { - return (Some(m), None); + return Some(m); } if paths::is_path_start(p) || p.at(L_ANGLE) { - let path_expr = path_expr(p, r); - return (Some(path_expr.0), path_expr.1); + return Some(path_expr(p, r)); } let la = p.nth(1); let done = match p.current() { @@ -98,7 +94,7 @@ pub(super) fn atom_expr( // } p.error("expected a loop"); m.complete(p, ERROR); - return (None, None); + return None; } } } @@ -115,10 +111,10 @@ pub(super) fn atom_expr( BREAK_KW => break_expr(p), _ => { p.err_recover("expected expression", EXPR_RECOVERY_SET); - return (None, None); + return None; } }; - (Some(done), None) + Some(done) } // test tuple_expr -- cgit v1.2.3