Skip to content

Commit 6f4f540

Browse files
committed
rustdoc: fix signature of onEachBtwnAsync
1 parent 4ee6f40 commit 6f4f540

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/librustdoc/html/static/js/search.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (!Array.prototype.toSpliced) {
2828
* @template T
2929
* @param {Iterable<T>} arr
3030
* @param {function(T): Promise<any>} func
31-
* @param {function(T): boolean} funcBtwn
31+
* @param {function(T): void} funcBtwn
3232
*/
3333
async function onEachBtwnAsync(arr, func, funcBtwn) {
3434
let skipped = true;
@@ -2421,7 +2421,6 @@ class DocSearch {
24212421
await onEachBtwnAsync(
24222422
fnType.generics,
24232423
nested => writeFn(nested, result),
2424-
// @ts-expect-error
24252424
() => pushText({ name: ", ", highlighted: false }, result),
24262425
);
24272426
pushText({ name: sb, highlighted: fnType.highlighted }, result);
@@ -2435,7 +2434,6 @@ class DocSearch {
24352434
prevHighlighted = !!value.highlighted;
24362435
await writeFn(value, result);
24372436
},
2438-
// @ts-expect-error
24392437
value => pushText({
24402438
name: " ",
24412439
highlighted: prevHighlighted && value.highlighted,
@@ -2454,7 +2452,6 @@ class DocSearch {
24542452
prevHighlighted = !!value.highlighted;
24552453
await writeFn(value, result);
24562454
},
2457-
// @ts-expect-error
24582455
value => pushText({
24592456
name: " ",
24602457
highlighted: prevHighlighted && value.highlighted,
@@ -2515,7 +2512,6 @@ class DocSearch {
25152512
await onEachBtwnAsync(
25162513
fnType.generics,
25172514
nested => writeFn(nested, where),
2518-
// @ts-expect-error
25192515
() => pushText({ name: " + ", highlighted: false }, where),
25202516
);
25212517
if (where.length > 0) {
@@ -2545,7 +2541,6 @@ class DocSearch {
25452541
await onEachBtwnAsync(
25462542
fnType.generics,
25472543
value => writeFn(value, result),
2548-
// @ts-expect-error
25492544
() => pushText({ name: ", ", highlighted: false }, result),
25502545
);
25512546
if (fnType.generics.length > 1) {
@@ -2568,6 +2563,7 @@ class DocSearch {
25682563
async([key, values]) => [await this.getName(key), values],
25692564
)),
25702565
async([name, values]) => {
2566+
// values[0] cannot be null due to length check
25712567
// @ts-expect-error
25722568
if (values.length === 1 && values[0].id < 0 &&
25732569
// @ts-expect-error
@@ -2593,14 +2589,12 @@ class DocSearch {
25932589
await onEachBtwnAsync(
25942590
values || [],
25952591
value => writeFn(value, result),
2596-
// @ts-expect-error
25972592
() => pushText({ name: " + ", highlighted: false }, result),
25982593
);
25992594
if (values.length !== 1) {
26002595
pushText({ name: ")", highlighted: false }, result);
26012596
}
26022597
},
2603-
// @ts-expect-error
26042598
() => pushText({ name: ", ", highlighted: false }, result),
26052599
);
26062600
}
@@ -2610,7 +2604,6 @@ class DocSearch {
26102604
await onEachBtwnAsync(
26112605
fnType.generics,
26122606
value => writeFn(value, result),
2613-
// @ts-expect-error
26142607
() => pushText({ name: ", ", highlighted: false }, result),
26152608
);
26162609
if (hasBindings || fnType.generics.length > 0) {
@@ -2623,14 +2616,12 @@ class DocSearch {
26232616
await onEachBtwnAsync(
26242617
fnInputs,
26252618
fnType => writeFn(fnType, type),
2626-
// @ts-expect-error
26272619
() => pushText({ name: ", ", highlighted: false }, type),
26282620
);
26292621
pushText({ name: " -> ", highlighted: false }, type);
26302622
await onEachBtwnAsync(
26312623
fnOutput,
26322624
fnType => writeFn(fnType, type),
2633-
// @ts-expect-error
26342625
() => pushText({ name: ", ", highlighted: false }, type),
26352626
);
26362627

0 commit comments

Comments
 (0)