@@ -429,9 +429,9 @@ function initSearch(rawSearchIndex) {
429429 }
430430 const posBefore = parserState . pos ;
431431 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.
435435 if ( posBefore === parserState . pos ) {
436436 parserState . pos += 1 ;
437437 }
@@ -581,7 +581,7 @@ function initSearch(rawSearchIndex) {
581581 const elem = document . getElementById ( "crate-search" ) ;
582582
583583 if ( elem &&
584- elem . value !== "All crates" &&
584+ elem . value !== "all crates" &&
585585 hasOwnPropertyRustdoc ( rawSearchIndex , elem . value )
586586 ) {
587587 return elem . value ;
@@ -1551,12 +1551,6 @@ function initSearch(rawSearchIndex) {
15511551 return [ displayPath , href ] ;
15521552 }
15531553
1554- function escape ( content ) {
1555- const h1 = document . createElement ( "h1" ) ;
1556- h1 . textContent = content ;
1557- return h1 . innerHTML ;
1558- }
1559-
15601554 function pathSplitter ( path ) {
15611555 const tmp = "<span>" + path . replace ( / : : / g, "::</span><span>" ) ;
15621556 if ( tmp . endsWith ( "<span>" ) ) {
@@ -1710,22 +1704,15 @@ function initSearch(rawSearchIndex) {
17101704 let crates = "" ;
17111705 const crates_list = Object . keys ( rawSearchIndex ) ;
17121706 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>" ;
17151709 for ( const c of crates_list ) {
17161710 crates += `<option value="${ c } " ${ c === filterCrates && "selected" } >${ c } </option>` ;
17171711 }
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>" ;
17241713 }
17251714
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>` ;
17291716 if ( results . query . error !== null ) {
17301717 output += `<h3>Query parser error: "${ results . query . error } ".</h3>` ;
17311718 output += "<div id=\"titles\">" +
@@ -2245,7 +2232,7 @@ function initSearch(rawSearchIndex) {
22452232 }
22462233
22472234 function updateCrate ( ev ) {
2248- if ( ev . target . value === "All crates" ) {
2235+ if ( ev . target . value === "all crates" ) {
22492236 // If we don't remove it from the URL, it'll be picked up again by the search.
22502237 const params = searchState . getQueryStringParams ( ) ;
22512238 const query = searchState . input . value . trim ( ) ;
0 commit comments