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