rustdoc-search: make type name correction choice deterministic
This commit is contained in:
parent
e0a7462d2f
commit
7529d87407
1 changed files with 3 additions and 0 deletions
|
@ -1609,6 +1609,9 @@ function initSearch(rawSearchIndex) {
|
|||
for (const [name, id] of typeNameIdMap) {
|
||||
const dist = editDistance(name, elem.name, maxEditDistance);
|
||||
if (dist <= matchDist && dist <= maxEditDistance) {
|
||||
if (dist === matchDist && matchName > name) {
|
||||
continue;
|
||||
}
|
||||
match = id;
|
||||
matchDist = dist;
|
||||
matchName = name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue