Commit 7c3f0d6
committed
Auto merge of rust-lang#107141 - notriddle:notriddle/max-lev-distance-2023, r=GuillaumeGomez
rustdoc: compute maximum Levenshtein distance based on the query
Preview: https://notriddle.com/notriddle-rustdoc-demos/search-lev-distance-2023/std/index.html?search=regex
The heuristic is pretty close to the name resolver, maxLevDistance = `Math.floor(queryLen / 3)`.
Fixes rust-lang#103357
Fixes rust-lang#82131
Similar to rust-lang#103710, but following the suggestion in rust-lang#103710 (comment) to use `floor` instead of `ceil`, and unblocked now that rust-lang#105796 made it so that setting the max lev distance to `0` doesn't cause substring matches to be removed.File tree
6 files changed
+108
-74
lines changed- src/librustdoc/html/static/js
- tests
- rustdoc-gui/src/test_docs
- rustdoc-js-std
- rustdoc-js
6 files changed
+108
-74
lines changed
0 commit comments