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
|
@ -33,7 +33,7 @@ impl JsonRenderer {
|
|||
_ => Some(Item {
|
||||
id: def_id.into(),
|
||||
crate_id: def_id.krate.as_u32(),
|
||||
name,
|
||||
name: name.map(|sym| sym.to_string()),
|
||||
source: self.convert_span(source),
|
||||
visibility: visibility.into(),
|
||||
docs: attrs.collapsed_doc_value().unwrap_or_default(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue