From 6b49e774e23c04a04ff5f377fc8dae25b5c69bb0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 11 Apr 2020 23:08:05 +0200 Subject: [PATCH] Remove dead code --- crates/ra_parser/src/grammar.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index d0530955e0..c2a6e82e9b 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs @@ -282,13 +282,10 @@ fn name_ref(p: &mut Parser) { } fn name_ref_or_index(p: &mut Parser) { - if p.at(IDENT) || p.at(INT_NUMBER) { - let m = p.start(); - p.bump_any(); - m.complete(p, NAME_REF); - } else { - p.err_and_bump("expected identifier"); - } + assert!(p.at(IDENT) || p.at(INT_NUMBER)); + let m = p.start(); + p.bump_any(); + m.complete(p, NAME_REF); } fn error_block(p: &mut Parser, message: &str) {