1
Fork 0

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:
Joshua Nelson 2020-12-14 19:30:36 -05:00
parent 89fc5034f4
commit a16904fecf
10 changed files with 78 additions and 45 deletions

View file

@ -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(),