about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/macro-print.js
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-12-16 11:12:59 -0700
committerMichael Howell <michael@notriddle.com>2023-01-14 12:04:11 -0700
commit59ba74cacb87ac89f7f5fcb5233eaccb50dd8349 (patch)
tree984fd0b11fea32d0232d95c46d802770cfd34112 /tests/rustdoc-js-std/macro-print.js
parent4b51adf6ffa1ae2286ea436eb48cbaa8771886e6 (diff)
downloadrust-59ba74cacb87ac89f7f5fcb5233eaccb50dd8349.tar.gz
rust-59ba74cacb87ac89f7f5fcb5233eaccb50dd8349.zip
rustdoc: simplify JS search routine by not messing with lev distance
Since the sorting function accounts for an `index` field, there's not much
reason to also be applying changes to the levenshtein distance. Instead,
we can just not treat `lev` as a filter if there's already a non-sentinel
value for `index`.

This change gives slightly more weight to the index and path part, as
search criteria, than it used to. This changes some of the test cases,
but not in any obviously-"worse" way, and, in particular, substring matches
are a bigger deal than levenshtein distances (we're assuming that a typo
is less likely than someone just not typing the entire name).

Based on
https://github.com/rust-lang/rust/pull/103710#issuecomment-1296894296
Diffstat (limited to 'tests/rustdoc-js-std/macro-print.js')
0 files changed, 0 insertions, 0 deletions