about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2023-12-12 12:26:00 -0700
committerMichael Howell <michael@notriddle.com>2023-12-13 10:37:52 -0700
commitbec66729849a1a62505170054df7b107344220cd (patch)
tree0dcc3d4f8fdb37fd9ee5776af401ed33f1fd7af2
parent9dfcf131b3a8c36c5d9f8c46b3f127e5709b2b93 (diff)
downloadrust-bec66729849a1a62505170054df7b107344220cd.tar.gz
rust-bec66729849a1a62505170054df7b107344220cd.zip
rustdoc-search: clean up handleSingleArg type handling
-rw-r--r--src/librustdoc/html/static/js/search.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js
index a7219066104..6fce7650b4c 100644
--- a/src/librustdoc/html/static/js/search.js
+++ b/src/librustdoc/html/static/js/search.js
@@ -2000,11 +2000,11 @@ function initSearch(rawSearchIndex) {
                 fullId,
                 parsedQuery.typeFingerprint
             );
-            if (tfpDist !== null &&
-                !(results_in_args.size >= MAX_RESULTS && tfpDist > results_in_args.max_dist)
-            ) {
+            if (tfpDist !== null) {
                 const in_args = row.type && row.type.inputs
                     && checkIfInList(row.type.inputs, elem, row.type.where_clause);
+                const returned = row.type && row.type.output
+                    && checkIfInList(row.type.output, elem, row.type.where_clause);
                 if (in_args) {
                     results_in_args.max_dist = Math.max(results_in_args.max_dist || 0, tfpDist);
                     const maxDist = results_in_args.size < MAX_RESULTS ?
@@ -2012,12 +2012,6 @@ function initSearch(rawSearchIndex) {
                         results_in_args.max_dist;
                     addIntoResults(results_in_args, fullId, pos, -1, tfpDist, 0, maxDist);
                 }
-            }
-            if (tfpDist !== false &&
-                !(results_returned.size >= MAX_RESULTS && tfpDist > results_returned.max_dist)
-            ) {
-                const returned = row.type && row.type.output
-                    && checkIfInList(row.type.output, elem, row.type.where_clause);
                 if (returned) {
                     results_returned.max_dist = Math.max(results_returned.max_dist || 0, tfpDist);
                     const maxDist = results_returned.size < MAX_RESULTS ?