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

@ -68,7 +68,7 @@ crate fn krate(mut cx: &mut DocContext<'_>) -> Crate {
m.items.extend(primitives.iter().map(|&(def_id, prim)| {
Item::from_def_id_and_parts(
def_id,
Some(prim.to_url_str().to_owned()),
Some(prim.as_sym()),
ItemKind::PrimitiveItem(prim),
cx,
)