Skip to content

Commit

Permalink
rustdoc: stop passing a title to replaceState second argument
Browse files Browse the repository at this point in the history
As described on [MDN's replaceState page], this parameter is not
currently used, and the empty string is "safe against future
changes to the method."

[MDN's replaceState page]: https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
  • Loading branch information
notriddle committed Apr 15, 2023
1 parent 84dd17b commit 0c61f58
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ function preLoadCss(cssUrl) {
document.title = searchState.titleBeforeSearch;
// We also remove the query parameter from the URL.
if (browserSupportsHistoryApi()) {
history.replaceState(null, window.currentCrate + " - Rust",
getNakedUrl() + window.location.hash);
history.replaceState(null, "", getNakedUrl() + window.location.hash);
}
},
getQueryStringParams: () => {
Expand Down Expand Up @@ -378,8 +377,7 @@ function preLoadCss(cssUrl) {
searchState.clearInputTimeout();
switchDisplayedElement(null);
if (browserSupportsHistoryApi()) {
history.replaceState(null, window.currentCrate + " - Rust",
getNakedUrl() + window.location.hash);
history.replaceState(null, "", getNakedUrl() + window.location.hash);
}
ev.preventDefault();
searchState.defocus();
Expand Down

0 comments on commit 0c61f58

Please sign in to comment.