File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
src/librustdoc/html/static/js Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1996,8 +1996,13 @@ function initSearch(rawSearchIndex) {
19961996 }
19971997
19981998 if ( results . query . correction !== null ) {
1999- output += "<h3 class=\"search-corrections\">Showing results for " +
2000- `"${ results . query . correction } ".</h3>` ;
1999+ const orig = results . query . returned . length > 0
2000+ ? results . query . returned [ 0 ] . name
2001+ : results . query . elems [ 0 ] . name ;
2002+ output += "<h3 class=\"search-corrections\">" +
2003+ `Type "${ orig } " not found. ` +
2004+ "Showing results for " +
2005+ `"${ results . query . correction } " instead.</h3>` ;
20012006 }
20022007
20032008 const resultsElem = document . createElement ( "div" ) ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ assert-css: (".search-corrections", {
2222})
2323assert-text: (
2424 ".search-corrections",
25- "Showing results for \"notablestructwithlongname\"."
25+ "Type \"notablestructwithlongnamr\" not found. Showing results for \"notablestructwithlongname\" instead ."
2626)
2727
2828// Corrections do get shown on the "In Return Type" tab.
@@ -33,7 +33,7 @@ assert-css: (".search-corrections", {
3333})
3434assert-text: (
3535 ".search-corrections",
36- "Showing results for \"notablestructwithlongname\"."
36+ "Type \"notablestructwithlongnamr\" not found. Showing results for \"notablestructwithlongname\" instead ."
3737)
3838
3939// Now, explicit return values
@@ -50,5 +50,5 @@ assert-css: (".search-corrections", {
5050})
5151assert-text: (
5252 ".search-corrections",
53- "Showing results for \"notablestructwithlongname\"."
53+ "Type \"notablestructwithlongnamr\" not found. Showing results for \"notablestructwithlongname\" instead ."
5454)
You can’t perform that action at this time.
0 commit comments