about summary refs log tree commit diff
path: root/src/librustdoc/html/url_parts_builder.rs
AgeCommit message (Collapse)AuthorLines
2022-05-21Remove `crate` visibility modifier in libs, testsJacob Pratt-8/+8
2022-01-14Document and test `UrlPartsBuilder::push_fmt`Noah Lev-0/+13
2022-01-14Make `AVG_PART_LENGTH` a power of 2Noah Lev-3/+10
I seem to recall that in general, it's best to request an allocation with a size that's a power of 2. The low estimate of 5 was probably a little too low as well.
2022-01-14Estimate path length instead of hardcoding 64 bytesNoah Lev-0/+8
2022-01-14rustdoc: avoid many `Symbol` to `String` conversions.Nicholas Nethercote-0/+33
Particularly when constructing file paths and fully qualified paths. This avoids a lot of allocations, speeding things up on almost all examples.
2021-12-13rustdoc: Add `UrlPartsBuilder`Noah Lev-0/+119
This is a type for efficiently and easily constructing the part of a URL after the domain: `nightly/core/str/struct.Bytes.html`. It allows simplifying some code and avoiding some allocations in the `href_*` functions. It will also allow making `Cache.paths` et al. use `Symbol` without having to allocate `String`s in the `href_*` functions. `String`s would be necessary otherwise because `Symbol::as_str()` returns `SymbolStr`, whose `Deref<Target = str>` impl requires the `str` to not outlive it. This is the primary motivation for the addition of `UrlPartsBuilder`.