Skip to content

Commit

Permalink
rustdoc: use restricted Damerau-Levenshtein distance for search
Browse files Browse the repository at this point in the history
Based on rust-lang#108200, for the same
rationale.

> This replaces the existing Levenshtein algorithm with the
> Damerau-Levenshtein algorithm. This means that "ab" to "ba" is one change
> (a transposition) instead of two (a deletion and insertion). More
> specifically, this is a restricted implementation, in that "ca" to "abc"
> cannot be performed as "ca" → "ac" → "abc", as there is an insertion in the
> middle of a transposition. I believe that errors like that are sufficiently
> rare that it's not worth taking into account.

Before this change, searching `prinltn!` listed `print!` first, followed
by `println!`. With this change, `println!` matches more closely.
  • Loading branch information
notriddle committed Mar 11, 2023
1 parent ff4b772 commit dfd9e5e
Show file tree
Hide file tree
Showing 2 changed files with 227 additions and 147 deletions.
Loading

0 comments on commit dfd9e5e

Please sign in to comment.