Skip to content

Commit 2aa33ba

Browse files
committed
rustdoc js: currentCrate is string and not optional
1 parent 36290c2 commit 2aa33ba

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,8 +2514,8 @@ class DocSearch {
25142514
*
25152515
* @param {rustdoc.ParsedQuery<rustdoc.ParserQueryElement>} origParsedQuery
25162516
* - The parsed user query
2517-
* @param {Object} [filterCrates] - Crate to search in if defined
2518-
* @param {Object} [currentCrate] - Current crate, to rank results from this crate higher
2517+
* @param {Object} filterCrates - Crate to search in if defined
2518+
* @param {string} currentCrate - Current crate, to rank results from this crate higher
25192519
*
25202520
* @return {Promise<rustdoc.ResultsTable>}
25212521
*/
@@ -4455,8 +4455,7 @@ class DocSearch {
44554455
}
44564456

44574457
results.max_dist = Math.max(results.max_dist || 0, tfpDist);
4458-
// @ts-expect-error
4459-
addIntoResults(results, row.id.toString(), pos, 0, tfpDist, 0, Number.MAX_VALUE);
4458+
addIntoResults(results, row.id, pos, 0, tfpDist, 0, Number.MAX_VALUE);
44604459
}
44614460

44624461
/**
@@ -4613,9 +4612,7 @@ class DocSearch {
46134612

46144613
const isType = parsedQuery.foundElems !== 1 || parsedQuery.hasReturnArrow;
46154614
const [sorted_in_args, sorted_returned, sorted_others] = await Promise.all([
4616-
// @ts-expect-error
46174615
sortResults(results_in_args, "elems", currentCrate),
4618-
// @ts-expect-error
46194616
sortResults(results_returned, "returned", currentCrate),
46204617
// @ts-expect-error
46214618
sortResults(results_others, (isType ? "query" : null), currentCrate),

0 commit comments

Comments
 (0)