@@ -2102,8 +2102,6 @@ function initSearch(rawSearchIndex) {
2102
2102
}
2103
2103
2104
2104
function innerRunQuery ( ) {
2105
- let elem , i , nSearchWords , in_returned , row ;
2106
-
2107
2105
let queryLen = 0 ;
2108
2106
for ( const elem of parsedQuery . elems ) {
2109
2107
queryLen += elem . name . length ;
@@ -2225,8 +2223,8 @@ function initSearch(rawSearchIndex) {
2225
2223
2226
2224
if ( parsedQuery . foundElems === 1 ) {
2227
2225
if ( parsedQuery . elems . length === 1 ) {
2228
- elem = parsedQuery . elems [ 0 ] ;
2229
- for ( i = 0 , nSearchWords = searchWords . length ; i < nSearchWords ; ++ i ) {
2226
+ const elem = parsedQuery . elems [ 0 ] ;
2227
+ for ( let i = 0 , nSearchWords = searchWords . length ; i < nSearchWords ; ++ i ) {
2230
2228
// It means we want to check for this element everywhere (in names, args and
2231
2229
// returned).
2232
2230
handleSingleArg (
@@ -2241,10 +2239,9 @@ function initSearch(rawSearchIndex) {
2241
2239
}
2242
2240
} else if ( parsedQuery . returned . length === 1 ) {
2243
2241
// We received one returned argument to check, so looking into returned values.
2244
- elem = parsedQuery . returned [ 0 ] ;
2245
- for ( i = 0 , nSearchWords = searchWords . length ; i < nSearchWords ; ++ i ) {
2246
- row = searchIndex [ i ] ;
2247
- in_returned = row . type && unifyFunctionTypes (
2242
+ for ( let i = 0 , nSearchWords = searchWords . length ; i < nSearchWords ; ++ i ) {
2243
+ const row = searchIndex [ i ] ;
2244
+ const in_returned = row . type && unifyFunctionTypes (
2248
2245
row . type . output ,
2249
2246
parsedQuery . returned ,
2250
2247
row . type . where_clause
@@ -2262,7 +2259,7 @@ function initSearch(rawSearchIndex) {
2262
2259
}
2263
2260
}
2264
2261
} else if ( parsedQuery . foundElems > 0 ) {
2265
- for ( i = 0 , nSearchWords = searchWords . length ; i < nSearchWords ; ++ i ) {
2262
+ for ( let i = 0 , nSearchWords = searchWords . length ; i < nSearchWords ; ++ i ) {
2266
2263
handleArgs ( searchIndex [ i ] , i , results_others ) ;
2267
2264
}
2268
2265
}
@@ -2418,7 +2415,6 @@ function initSearch(rawSearchIndex) {
2418
2415
const extraClass = display ? " active" : "" ;
2419
2416
2420
2417
const output = document . createElement ( "div" ) ;
2421
- let length = 0 ;
2422
2418
if ( array . length > 0 ) {
2423
2419
output . className = "search-results " + extraClass ;
2424
2420
@@ -2428,8 +2424,6 @@ function initSearch(rawSearchIndex) {
2428
2424
const longType = longItemTypes [ item . ty ] ;
2429
2425
const typeName = longType . length !== 0 ? `${ longType } ` : "?" ;
2430
2426
2431
- length += 1 ;
2432
-
2433
2427
const link = document . createElement ( "a" ) ;
2434
2428
link . className = "result-" + type ;
2435
2429
link . href = item . href ;
@@ -2477,7 +2471,7 @@ ${item.displayPath}<span class="${type}">${name}</span>\
2477
2471
"href=\"https://docs.rs\">Docs.rs</a> for documentation of crates released on" +
2478
2472
" <a href=\"https://crates.io/\">crates.io</a>.</li></ul>" ;
2479
2473
}
2480
- return [ output , length ] ;
2474
+ return [ output , array . length ] ;
2481
2475
}
2482
2476
2483
2477
function makeTabHeader ( tabNb , text , nbElems ) {
0 commit comments