From 9886c233d84c231030af76419d002996df981ebc Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 18 Sep 2021 18:01:36 +0200 Subject: Remove Symbol::len It is used exactly once and can be replaced with the equally fast .as_str().len() --- compiler/rustc_span/src/symbol.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'compiler/rustc_span/src') diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 7c2a09e0a32..eaf92487bff 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1642,10 +1642,6 @@ impl Symbol { self.0.as_u32() } - pub fn len(self) -> usize { - with_session_globals(|session_globals| session_globals.symbol_interner.get(self).len()) - } - pub fn is_empty(self) -> bool { self == kw::Empty } -- cgit 1.4.1-3-g733a5 From df727490b6adf58dc9ceb50440d930a989bd9729 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 18 Sep 2021 18:04:20 +0200 Subject: Make SymbolIndex private --- compiler/rustc_span/src/symbol.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_span/src') diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index eaf92487bff..89b50c9afb2 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1616,7 +1616,7 @@ impl fmt::Display for MacroRulesNormalizedIdent { pub struct Symbol(SymbolIndex); rustc_index::newtype_index! { - pub struct SymbolIndex { .. } + struct SymbolIndex { .. } } impl Symbol { -- cgit 1.4.1-3-g733a5