rustdoc: clean up redundant search hiding results code

* There's no need to call `history.replaceState` right before
    calling `searchState.hideResults`, which already does it.
  * There's no need to implement hiding search results when that
    is already implemented.
This commit is contained in:
Michael Howell 2023-04-21 15:07:52 -07:00
parent 9d69ee0574
commit 0cd3874155
2 changed files with 1 additions and 8 deletions

View file

@ -2412,10 +2412,6 @@ function initSearch(rawSearchIndex) {
const searchAfter500ms = () => {
searchState.clearInputTimeout();
if (searchState.input.value.length === 0) {
if (browserSupportsHistoryApi()) {
history.replaceState(null, window.currentCrate + " - Rust",
getNakedUrl() + window.location.hash);
}
searchState.hideResults();
} else {
searchState.timeout = setTimeout(search, 500);