Skip to content

Commit 97c18f4

Browse files
Improve results a bit
1 parent 6351ebb commit 97c18f4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/librustdoc/html/static/main.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,12 @@
926926
}
927927

928928
lev += lev_add;
929-
if (searchWords[j].startsWith(val)) {
930-
lev -= 1;
929+
if (lev > 0 && val.length > 3 && searchWords[j].startsWith(val)) {
930+
if (val.length < 6) {
931+
lev -= 1;
932+
} else {
933+
lev = 0;
934+
}
931935
}
932936
if (in_args <= MAX_LEV_DISTANCE) {
933937
if (results_in_args[fullId] === undefined) {

0 commit comments

Comments
 (0)