-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustdoc: make srcIndex no longer a global variable #142100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
rustdoc: make srcIndex no longer a global variable #142100
Conversation
r? @notriddle rustbot has assigned @notriddle. Use |
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha, @lolbinarycat Some changes occurred in GUI tests. |
This comment has been minimized.
This comment has been minimized.
this is one-time initialization data, it can just be a function parameter. we also move the json parsing into createSrcSidebar to save a few bytes.
80d65ae
to
1f4435a
Compare
Seems good to me, thanks! Please remove the left-over debugging and then I'll approve. |
tests/rustdoc-gui/globals.goml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this exist? searchIndex
isn't part of the intended external interface, either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, at least the search index is something we actually want to persist, but I suppose it could just live in a closure upvar instead of a global.
The results table needs to be public for integration testing, although i'm not sure if the same is true of searchIndex (it's definitely not true for srcIndex, I checked)
Co-authored-by: erikdesjardins <[email protected]>
this is one-time initialization data, it can just
be a function parameter.
while we're doing that, we can more the json parsing into the function and save a few extra bytes of storage for free, at least in the case of multiple crates in a doc bundle.
fixes #138467