From 370fcce5646a55a15f2753bb3d8f249d065e192e Mon Sep 17 00:00:00 2001 From: binarycat Date: Thu, 25 Jul 2024 17:51:35 -0400 Subject: [PATCH 1/2] rustdoc: change title of search results the current title is too similar to that of the page for std::result::Result, which is a problem both for navigating to the Result docs via browser autocomplete, and for being able to tell which tab is which when the width of tabs is small. --- src/librustdoc/html/static/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js index 86af38f3ee75e..c6618c9859c79 100644 --- a/src/librustdoc/html/static/js/search.js +++ b/src/librustdoc/html/static/js/search.js @@ -2932,7 +2932,7 @@ ${item.displayPath}${name}\ } // Update document title to maintain a meaningful browser history - searchState.title = "Results for " + query.original + " - Rust"; + searchState.title = '"' + query.original + '" Search - Rust'; // Because searching is incremental by character, only the most // recent search query is added to the browser history. From 587b64e88b19d6e5ca0fed53f3538168df949ed5 Mon Sep 17 00:00:00 2001 From: binarycat Date: Thu, 25 Jul 2024 18:55:45 -0400 Subject: [PATCH 2/2] use double quotes --- src/librustdoc/html/static/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js index c6618c9859c79..3eb27ea087c1d 100644 --- a/src/librustdoc/html/static/js/search.js +++ b/src/librustdoc/html/static/js/search.js @@ -2932,7 +2932,7 @@ ${item.displayPath}${name}\ } // Update document title to maintain a meaningful browser history - searchState.title = '"' + query.original + '" Search - Rust'; + searchState.title = "\"" + query.original + "\" Search - Rust"; // Because searching is incremental by character, only the most // recent search query is added to the browser history.