File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/librustdoc/html/static Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -714,7 +714,10 @@ if (!DOMTokenList.prototype.remove) {
714714 }
715715 lev_distance = Math . min ( levenshtein ( obj [ NAME ] , val . name ) , lev_distance ) ;
716716 if ( lev_distance <= MAX_LEV_DISTANCE ) {
717- lev_distance = Math . min ( checkGenerics ( obj , val ) , lev_distance ) ;
717+ // The generics didn't match but the name kinda did so we give it
718+ // a levenshtein distance value that isn't *this* good so it goes
719+ // into the search results but not too high.
720+ lev_distance = Math . ceil ( ( checkGenerics ( obj , val ) + lev_distance ) / 2 ) ;
718721 } else if ( obj . length > GENERICS_DATA && obj [ GENERICS_DATA ] . length > 0 ) {
719722 // We can check if the type we're looking for is inside the generics!
720723 var olength = obj [ GENERICS_DATA ] . length ;
You can’t perform that action at this time.
0 commit comments