File tree 2 files changed +10
-5
lines changed
src/librustdoc/html/static/js
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1996,8 +1996,13 @@ function initSearch(rawSearchIndex) {
1996
1996
}
1997
1997
1998
1998
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>` ;
2001
2006
}
2002
2007
2003
2008
const resultsElem = document . createElement ( "div" ) ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ assert-css: (".search-corrections", {
22
22
})
23
23
assert-text: (
24
24
".search-corrections",
25
- "Showing results for \"notablestructwithlongname\"."
25
+ "Type \"notablestructwithlongnamr\" not found. Showing results for \"notablestructwithlongname\" instead ."
26
26
)
27
27
28
28
// Corrections do get shown on the "In Return Type" tab.
@@ -33,7 +33,7 @@ assert-css: (".search-corrections", {
33
33
})
34
34
assert-text: (
35
35
".search-corrections",
36
- "Showing results for \"notablestructwithlongname\"."
36
+ "Type \"notablestructwithlongnamr\" not found. Showing results for \"notablestructwithlongname\" instead ."
37
37
)
38
38
39
39
// Now, explicit return values
@@ -50,5 +50,5 @@ assert-css: (".search-corrections", {
50
50
})
51
51
assert-text: (
52
52
".search-corrections",
53
- "Showing results for \"notablestructwithlongname\"."
53
+ "Type \"notablestructwithlongnamr\" not found. Showing results for \"notablestructwithlongname\" instead ."
54
54
)
You can’t perform that action at this time.
0 commit comments