Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ca514c1

Browse files
committed
search.js: fix signature of pushText
1 parent 714be45 commit ca514c1

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2901,7 +2901,7 @@ class DocSearch {
29012901
const whereClause = new Map();
29022902

29032903
const fnParamNames = obj.paramNames || [];
2904-
// @ts-expect-error
2904+
/** @type {string[]} */
29052905
const queryParamNames = [];
29062906
/**
29072907
* Recursively writes a map of IDs to query generic names,
@@ -2934,7 +2934,7 @@ class DocSearch {
29342934
* index 2 is not highlighted, etc.
29352935
*
29362936
* @param {{name?: string, highlighted?: boolean}} fnType - input
2937-
* @param {[string]} result
2937+
* @param {string[]} result
29382938
*/
29392939
const pushText = (fnType, result) => {
29402940
// If !!(result.length % 2) == false, then pushing a new slot starts an even
@@ -2946,7 +2946,6 @@ class DocSearch {
29462946
// needs coerced to a boolean.
29472947
if (!!(result.length % 2) === !!fnType.highlighted) {
29482948
result.push("");
2949-
// @ts-expect-error
29502949
} else if (result.length === 0 && !!fnType.highlighted) {
29512950
result.push("");
29522951
result.push("");
@@ -2960,7 +2959,7 @@ class DocSearch {
29602959
* or a trait bound on Fn, FnMut, or FnOnce.
29612960
*
29622961
* @param {rustdoc.HighlightedFunctionType} fnType - input
2963-
* @param {[string]} result
2962+
* @param {string[]} result
29642963
*/
29652964
const writeHof = (fnType, result) => {
29662965
const hofOutput = fnType.bindings.get(this.typeNameIdOfOutput) || [];
@@ -3000,7 +2999,7 @@ class DocSearch {
30002999
* Returns `false` if the supplied type isn't special.
30013000
*
30023001
* @param {rustdoc.HighlightedFunctionType} fnType
3003-
* @param {[string]} result
3002+
* @param {string[]} result
30043003
*/
30053004
const writeSpecialPrimitive = (fnType, result) => {
30063005
if (fnType.id === this.typeNameIdOfArray || fnType.id === this.typeNameIdOfSlice ||
@@ -3047,7 +3046,7 @@ class DocSearch {
30473046
* updating the where clause and generic type param map.
30483047
*
30493048
* @param {rustdoc.HighlightedFunctionType} fnType
3050-
* @param {[string]} result
3049+
* @param {string[]} result
30513050
*/
30523051
const writeFn = (fnType, result) => {
30533052
if (fnType.id !== null && fnType.id < 0) {
@@ -3065,7 +3064,6 @@ class DocSearch {
30653064
for (const [queryId, fnId] of mgens) {
30663065
if (fnId === fnType.id) {
30673066
mappedNames.set(
3068-
// @ts-expect-error
30693067
queryParamNames[-1 - queryId],
30703068
fnParamNames[-1 - fnType.id],
30713069
);
@@ -3080,7 +3078,6 @@ class DocSearch {
30803078
const where = [];
30813079
onEachBtwn(
30823080
fnType.generics,
3083-
// @ts-expect-error
30843081
nested => writeFn(nested, where),
30853082
// @ts-expect-error
30863083
() => pushText({ name: " + ", highlighted: false }, where),
@@ -3115,7 +3112,6 @@ class DocSearch {
31153112
// shown in the where clause and name mapping output, but is
31163113
// redundant in this spot
31173114
for (const value of values) {
3118-
// @ts-expect-error
31193115
writeFn(value, []);
31203116
}
31213117
return true;

0 commit comments

Comments
 (0)