Skip to content

Commit 34b7265

Browse files
committed
rustdoc-search: clean up handleSingleArg type handling
1 parent 4a0dee7 commit 34b7265

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
@@ -2005,24 +2005,18 @@ function initSearch(rawSearchIndex) {
20052005
fullId,
20062006
parsedQuery.typeFingerprint
20072007
);
2008-
if (tfpDist !== null &&
2009-
!(results_in_args.size >= MAX_RESULTS && tfpDist > results_in_args.max_dist)
2010-
) {
2008+
if (tfpDist !== null) {
20112009
const in_args = row.type && row.type.inputs
20122010
&& checkIfInList(row.type.inputs, elem, row.type.where_clause);
2011+
const returned = row.type && row.type.output
2012+
&& checkIfInList(row.type.output, elem, row.type.where_clause);
20132013
if (in_args) {
20142014
results_in_args.max_dist = Math.max(results_in_args.max_dist || 0, tfpDist);
20152015
const maxDist = results_in_args.size < MAX_RESULTS ?
20162016
(tfpDist + 1) :
20172017
results_in_args.max_dist;
20182018
addIntoResults(results_in_args, fullId, pos, -1, tfpDist, 0, maxDist);
20192019
}
2020-
}
2021-
if (tfpDist !== false &&
2022-
!(results_returned.size >= MAX_RESULTS && tfpDist > results_returned.max_dist)
2023-
) {
2024-
const returned = row.type && row.type.output
2025-
&& checkIfInList(row.type.output, elem, row.type.where_clause);
20262020
if (returned) {
20272021
results_returned.max_dist = Math.max(results_returned.max_dist || 0, tfpDist);
20282022
const maxDist = results_returned.size < MAX_RESULTS ?

0 commit comments

Comments
 (0)