@@ -1569,7 +1569,13 @@ function initSearch(rawSearchIndex) {
1569
1569
highlighted : ! ! fnType . highlighted ,
1570
1570
} , result ) ;
1571
1571
const where = [ ] ;
1572
+ let first = true ;
1572
1573
for ( const nested of fnType . generics ) {
1574
+ if ( first ) {
1575
+ first = false ;
1576
+ } else {
1577
+ pushText ( { name : " + " , highlighted : false } , where ) ;
1578
+ }
1573
1579
writeFn ( nested , where ) ;
1574
1580
}
1575
1581
if ( where . length > 0 ) {
@@ -3080,13 +3086,18 @@ ${item.displayPath}<span class="${type}">${name}</span>\
3080
3086
tooltip . href = `#${ tooltip . id } ` ;
3081
3087
const tooltipCode = document . createElement ( "code" ) ;
3082
3088
for ( const [ name , qname ] of mappedNames ) {
3089
+ // don't care unless the generic name is different
3090
+ if ( name === qname ) {
3091
+ continue ;
3092
+ }
3083
3093
const line = document . createElement ( "div" ) ;
3084
3094
line . className = "where" ;
3085
3095
line . appendChild ( document . createTextNode ( `${ name } is ${ qname } ` ) ) ;
3086
3096
tooltipCode . appendChild ( line ) ;
3087
3097
}
3088
3098
for ( const [ name , innerType ] of whereClause ) {
3089
- if ( innerType . length === 0 ) {
3099
+ // don't care unless there's at least one highlighted entry
3100
+ if ( innerType . length <= 1 ) {
3090
3101
continue ;
3091
3102
}
3092
3103
const line = document . createElement ( "div" ) ;
@@ -3103,20 +3114,22 @@ ${item.displayPath}<span class="${type}">${name}</span>\
3103
3114
} ) ;
3104
3115
tooltipCode . appendChild ( line ) ;
3105
3116
}
3106
- tooltip . RUSTDOC_TOOLTIP_DOM = document . createElement ( "div" ) ;
3107
- tooltip . RUSTDOC_TOOLTIP_DOM . className = "content" ;
3108
- const tooltipH3 = document . createElement ( "h3" ) ;
3109
- tooltipH3 . innerHTML = "About this result" ;
3110
- tooltip . RUSTDOC_TOOLTIP_DOM . appendChild ( tooltipH3 ) ;
3111
- const tooltipPre = document . createElement ( "pre" ) ;
3112
- tooltipPre . appendChild ( tooltipCode ) ;
3113
- tooltip . RUSTDOC_TOOLTIP_DOM . appendChild ( tooltipPre ) ;
3114
- tooltip . typeWhereClause = whereClause ;
3115
- tooltip . innerText = "ⓘ" ;
3116
- tooltip . className = "tooltip" ;
3117
- window . rustdocConfigureTooltip ( tooltip ) ;
3118
- displayType . appendChild ( tooltip ) ;
3119
- displayType . appendChild ( document . createTextNode ( " " ) ) ;
3117
+ if ( tooltipCode . childNodes . length !== 0 ) {
3118
+ tooltip . RUSTDOC_TOOLTIP_DOM = document . createElement ( "div" ) ;
3119
+ tooltip . RUSTDOC_TOOLTIP_DOM . className = "content" ;
3120
+ const tooltipH3 = document . createElement ( "h3" ) ;
3121
+ tooltipH3 . innerHTML = "About this result" ;
3122
+ tooltip . RUSTDOC_TOOLTIP_DOM . appendChild ( tooltipH3 ) ;
3123
+ const tooltipPre = document . createElement ( "pre" ) ;
3124
+ tooltipPre . appendChild ( tooltipCode ) ;
3125
+ tooltip . RUSTDOC_TOOLTIP_DOM . appendChild ( tooltipPre ) ;
3126
+ tooltip . typeWhereClause = whereClause ;
3127
+ tooltip . innerText = "ⓘ" ;
3128
+ tooltip . className = "tooltip" ;
3129
+ window . rustdocConfigureTooltip ( tooltip ) ;
3130
+ displayType . appendChild ( tooltip ) ;
3131
+ displayType . appendChild ( document . createTextNode ( " " ) ) ;
3132
+ }
3120
3133
}
3121
3134
type . forEach ( ( value , index ) => {
3122
3135
if ( index % 2 !== 0 ) {
0 commit comments