Skip to content

Commit

Permalink
Enforce search typed queries
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 30, 2021
1 parent 451e98e commit 7b62d28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustdoc/html/static/search.js
Expand Up @@ -801,7 +801,8 @@ window.initSearch = function(rawSearchIndex) {
results_returned[fullId].lev =
Math.min(results_returned[fullId].lev, returned);
}
if (index !== -1 || lev <= MAX_LEV_DISTANCE) {
if (typePassesFilter(typeFilter, ty.ty) &&
(index !== -1 || lev <= MAX_LEV_DISTANCE)) {
if (index !== -1 && paths.length < 2) {
lev = 0;
}
Expand Down

0 comments on commit 7b62d28

Please sign in to comment.