rustdoc: Replace String with Symbol in Cache.paths et al.#91876
Closed
camelid wants to merge 2 commits intorust-lang:masterfrom
Closed
rustdoc: Replace String with Symbol in Cache.paths et al.#91876camelid wants to merge 2 commits intorust-lang:masterfrom
Cache.paths et al.#91876camelid wants to merge 2 commits intorust-lang:masterfrom
Conversation
This was referenced Dec 13, 2021
camelid
commented
Dec 13, 2021
Comment on lines
+120
to
+135
Member
Author
There was a problem hiding this comment.
I'm worried this is too "magical", but it does really help at several call sites.
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`.
This should hopefully improve memory usage and rustdoc run time. It's also more consistent with the rest of rustc and rustdoc.
This comment has been minimized.
This comment has been minimized.
Member
Author
|
Hmm, somehow this broke linking to external items. |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Member
Author
|
#91948 covers this and its CI is passing. Closing this PR. |
Contributor
|
Oh geez, my first ever contribution to rustdoc and I'm stepping on your toes... sorry :( Unfortunate timing. |
Member
Author
Thanks ❤️ At least I'll be able to review your PR better ;) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blocked on #91871.
This should hopefully improve memory usage and rustdoc run time.
It's also more consistent with the rest of rustc and rustdoc.
r? @jyn514