Switch to Symbol for item.name
This decreases the size of `Item` from 680 to 616 bytes. It also does a lot less work since it no longer has to copy as much.
This commit is contained in:
parent
89fc5034f4
commit
a16904fecf
10 changed files with 78 additions and 45 deletions
|
@ -1469,6 +1469,10 @@ impl Symbol {
|
|||
self.0.as_u32()
|
||||
}
|
||||
|
||||
pub fn is_empty(self) -> bool {
|
||||
self == kw::Invalid
|
||||
}
|
||||
|
||||
/// This method is supposed to be used in error messages, so it's expected to be
|
||||
/// identical to printing the original identifier token written in source code
|
||||
/// (`token_to_string`, `Ident::to_string`), except that symbols don't keep the rawness flag
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue