Remove Symbol::len
It is used exactly once and can be replaced with the equally fast .as_str().len()
This commit is contained in:
parent
ce45663e14
commit
9886c233d8
@ -577,7 +577,7 @@ fn from_str(&mut self, s: &str) -> Result<Self::Literal, ()> {
|
||||
}
|
||||
|
||||
// Synthesize a new symbol that includes the minus sign.
|
||||
let symbol = Symbol::intern(&s[..1 + lit.symbol.len()]);
|
||||
let symbol = Symbol::intern(&s[..1 + lit.symbol.as_str().len()]);
|
||||
lit = token::Lit::new(lit.kind, symbol, lit.suffix);
|
||||
}
|
||||
|
||||
|
@ -1642,10 +1642,6 @@ pub fn as_u32(self) -> u32 {
|
||||
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user