@@ -429,9 +429,9 @@ function initSearch(rawSearchIndex) {
429
429
}
430
430
const posBefore = parserState . pos ;
431
431
getNextElem ( query , parserState , elems , endChar === ">" ) ;
432
- // This case can be encountered if `getNextElem` encounted a "stop character" right from
433
- // the start. For example if you have `,,` or `<>`. In this case, we simply move up the
434
- // current position to continue the parsing.
432
+ // This case can be encountered if `getNextElem` encountered a "stop character" right
433
+ // from the start. For example if you have `,,` or `<>`. In this case, we simply move up
434
+ // the current position to continue the parsing.
435
435
if ( posBefore === parserState . pos ) {
436
436
parserState . pos += 1 ;
437
437
}
@@ -581,7 +581,7 @@ function initSearch(rawSearchIndex) {
581
581
const elem = document . getElementById ( "crate-search" ) ;
582
582
583
583
if ( elem &&
584
- elem . value !== "All crates" &&
584
+ elem . value !== "all crates" &&
585
585
hasOwnPropertyRustdoc ( rawSearchIndex , elem . value )
586
586
) {
587
587
return elem . value ;
@@ -1551,12 +1551,6 @@ function initSearch(rawSearchIndex) {
1551
1551
return [ displayPath , href ] ;
1552
1552
}
1553
1553
1554
- function escape ( content ) {
1555
- const h1 = document . createElement ( "h1" ) ;
1556
- h1 . textContent = content ;
1557
- return h1 . innerHTML ;
1558
- }
1559
-
1560
1554
function pathSplitter ( path ) {
1561
1555
const tmp = "<span>" + path . replace ( / : : / g, "::</span><span>" ) ;
1562
1556
if ( tmp . endsWith ( "<span>" ) ) {
@@ -1710,22 +1704,15 @@ function initSearch(rawSearchIndex) {
1710
1704
let crates = "" ;
1711
1705
const crates_list = Object . keys ( rawSearchIndex ) ;
1712
1706
if ( crates_list . length > 1 ) {
1713
- crates = " in <select id=\"crate-search\"><option value =\"All crates \">" +
1714
- "All crates</option>" ;
1707
+ crates = " in <div id=\"crate-search-div \"><select id =\"crate-search \">" +
1708
+ "<option value=\"all crates\">all crates</option>" ;
1715
1709
for ( const c of crates_list ) {
1716
1710
crates += `<option value="${ c } " ${ c === filterCrates && "selected" } >${ c } </option>` ;
1717
1711
}
1718
- crates += "</select>" ;
1719
- }
1720
-
1721
- let typeFilter = "" ;
1722
- if ( results . query . typeFilter !== NO_TYPE_FILTER ) {
1723
- typeFilter = " (type: " + escape ( itemTypes [ results . query . typeFilter ] ) + ")" ;
1712
+ crates += "</select></div>" ;
1724
1713
}
1725
1714
1726
- let output = "<div id=\"search-settings\">" +
1727
- `<h1 class="search-results-title">Results for ${ escape ( results . query . userQuery ) } ` +
1728
- `${ typeFilter } </h1>${ crates } </div>` ;
1715
+ let output = `<h1 class="search-results-title">Results${ crates } </h1>` ;
1729
1716
if ( results . query . error !== null ) {
1730
1717
output += `<h3>Query parser error: "${ results . query . error } ".</h3>` ;
1731
1718
output += "<div id=\"titles\">" +
@@ -2245,7 +2232,7 @@ function initSearch(rawSearchIndex) {
2245
2232
}
2246
2233
2247
2234
function updateCrate ( ev ) {
2248
- if ( ev . target . value === "All crates" ) {
2235
+ if ( ev . target . value === "all crates" ) {
2249
2236
// If we don't remove it from the URL, it'll be picked up again by the search.
2250
2237
const params = searchState . getQueryStringParams ( ) ;
2251
2238
const query = searchState . input . value . trim ( ) ;
0 commit comments