From 8f84d9e1de91261682d5e4ef8f046c9491802dee Mon Sep 17 00:00:00 2001 From: Charles Lew Date: Mon, 30 Dec 2019 20:00:05 +0800 Subject: [PATCH] Inline and remove `nfc_symbol_from` method. --- src/librustc_parse/lexer/mod.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/librustc_parse/lexer/mod.rs b/src/librustc_parse/lexer/mod.rs index b981e8d066fcd..30ec202e0ffe3 100644 --- a/src/librustc_parse/lexer/mod.rs +++ b/src/librustc_parse/lexer/mod.rs @@ -220,7 +220,7 @@ impl<'a> StringReader<'a> { if is_raw_ident { ident_start = ident_start + BytePos(2); } - let sym = self.nfc_symbol_from(ident_start); + let sym = nfc_normalize(self.str_from(ident_start)); if is_raw_ident { let span = self.mk_sp(start, self.pos); if !sym.can_be_raw() { @@ -469,13 +469,6 @@ impl<'a> StringReader<'a> { Symbol::intern(self.str_from_to(start, end)) } - /// As symbol_from, with the text normalized into Unicode NFC form. - fn nfc_symbol_from(&self, start: BytePos) -> Symbol { - debug!("taking an normalized ident from {:?} to {:?}", start, self.pos); - let sym = self.str_from(start); - nfc_normalize(sym) - } - /// Slice of the source text spanning from `start` up to but excluding `end`. fn str_from_to(&self, start: BytePos, end: BytePos) -> &str { &self.src[self.src_index(start)..self.src_index(end)]