Skip to content

Commit

Permalink
Auto merge of #107141 - notriddle:notriddle/max-lev-distance-2023, r=…
Browse files Browse the repository at this point in the history
…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 #103357
Fixes #82131

Similar to rust-lang/rust#103710, but following the suggestion in rust-lang/rust#103710 (comment) to use `floor` instead of `ceil`, and unblocked now that rust-lang/rust#105796 made it so that setting the max lev distance to `0` doesn't cause substring matches to be removed.
  • Loading branch information
bors committed Feb 6, 2023
2 parents d0fd429 + 25d2c81 commit 313a19e
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 313a19e

Please sign in to comment.