Description
When you do a search on a rustdoc page, we use the history API to modify the URL bar and represent the current search. For instance if you search for "vec" from the String page, you'd get:
https://doc.rust-lang.org/std/string/struct.String.html?search=vec
But if you searched for "vec" from the slice page, you'd get:
https://doc.rust-lang.org/std/slice/index.html?search=vec
Conceptually, though, these are the same: the search results for "vec" within /std/. Since History.pushState()
lets us choose whatever URL we want within the same origin, we should remove the part that's specific to the page you started on, and generate a URL like so:
https://doc.rust-lang.org/std/index.html?search=vec
(note the index.html rather than just /std/, so this works properly when loading local files).
I'm happy to work on this.