Skip to content

Commit 7529d87

Browse files
committed
rustdoc-search: make type name correction choice deterministic
1 parent e0a7462 commit 7529d87

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustdoc/html/static/js/search.js

+3
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,9 @@ function initSearch(rawSearchIndex) {
16091609
for (const [name, id] of typeNameIdMap) {
16101610
const dist = editDistance(name, elem.name, maxEditDistance);
16111611
if (dist <= matchDist && dist <= maxEditDistance) {
1612+
if (dist === matchDist && matchName > name) {
1613+
continue;
1614+
}
16121615
match = id;
16131616
matchDist = dist;
16141617
matchName = name;

0 commit comments

Comments
 (0)