Skip to content

Commit bec6672

Browse files
committed
rustdoc-search: clean up handleSingleArg type handling
1 parent 9dfcf13 commit bec6672

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

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

+3-9
Original file line numberDiff line numberDiff line change
@@ -2000,24 +2000,18 @@ function initSearch(rawSearchIndex) {
20002000
fullId,
20012001
parsedQuery.typeFingerprint
20022002
);
2003-
if (tfpDist !== null &&
2004-
!(results_in_args.size >= MAX_RESULTS && tfpDist > results_in_args.max_dist)
2005-
) {
2003+
if (tfpDist !== null) {
20062004
const in_args = row.type && row.type.inputs
20072005
&& checkIfInList(row.type.inputs, elem, row.type.where_clause);
2006+
const returned = row.type && row.type.output
2007+
&& checkIfInList(row.type.output, elem, row.type.where_clause);
20082008
if (in_args) {
20092009
results_in_args.max_dist = Math.max(results_in_args.max_dist || 0, tfpDist);
20102010
const maxDist = results_in_args.size < MAX_RESULTS ?
20112011
(tfpDist + 1) :
20122012
results_in_args.max_dist;
20132013
addIntoResults(results_in_args, fullId, pos, -1, tfpDist, 0, maxDist);
20142014
}
2015-
}
2016-
if (tfpDist !== false &&
2017-
!(results_returned.size >= MAX_RESULTS && tfpDist > results_returned.max_dist)
2018-
) {
2019-
const returned = row.type && row.type.output
2020-
&& checkIfInList(row.type.output, elem, row.type.where_clause);
20212015
if (returned) {
20222016
results_returned.max_dist = Math.max(results_returned.max_dist || 0, tfpDist);
20232017
const maxDist = results_returned.size < MAX_RESULTS ?

0 commit comments

Comments
 (0)