rustdoc: avoid many Symbol to String conversions.

Particularly when constructing file paths and fully qualified paths.
This avoids a lot of allocations, speeding things up on almost all
examples.
This commit is contained in:
Nicholas Nethercote 2021-12-15 06:18:18 +11:00 committed by Noah Lev
parent 02c9e73e6c
commit 10b1c9aa8b
13 changed files with 198 additions and 120 deletions

View file

@ -562,7 +562,7 @@ pub(super) fn write_shared(
let mut mydst = dst.clone();
for part in &remote_path[..remote_path.len() - 1] {
mydst.push(part);
mydst.push(part.to_string());
}
cx.shared.ensure_dir(&mydst)?;
mydst.push(&format!("{}.{}.js", remote_item_type, remote_path[remote_path.len() - 1]));