@@ -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 ) {
@@ -3076,13 +3082,18 @@ ${item.displayPath}<span class="${type}">${name}</span>\
3076
3082
tooltip . href = `#${ tooltip . id } ` ;
3077
3083
const tooltipCode = document . createElement ( "code" ) ;
3078
3084
for ( const [ name , qname ] of mappedNames ) {
3085
+ // don't care unless the generic name is different
3086
+ if ( name === qname ) {
3087
+ continue ;
3088
+ }
3079
3089
const line = document . createElement ( "div" ) ;
3080
3090
line . className = "where" ;
3081
3091
line . appendChild ( document . createTextNode ( `${ name } is ${ qname } ` ) ) ;
3082
3092
tooltipCode . appendChild ( line ) ;
3083
3093
}
3084
3094
for ( const [ name , innerType ] of whereClause ) {
3085
- if ( innerType . length === 0 ) {
3095
+ // don't care unless there's at least one highlighted entry
3096
+ if ( innerType . length <= 1 ) {
3086
3097
continue ;
3087
3098
}
3088
3099
const line = document . createElement ( "div" ) ;
@@ -3099,20 +3110,22 @@ ${item.displayPath}<span class="${type}">${name}</span>\
3099
3110
} ) ;
3100
3111
tooltipCode . appendChild ( line ) ;
3101
3112
}
3102
- tooltip . RUSTDOC_TOOLTIP_DOM = document . createElement ( "div" ) ;
3103
- tooltip . RUSTDOC_TOOLTIP_DOM . className = "content" ;
3104
- const tooltipH3 = document . createElement ( "h3" ) ;
3105
- tooltipH3 . innerHTML = "About this result" ;
3106
- tooltip . RUSTDOC_TOOLTIP_DOM . appendChild ( tooltipH3 ) ;
3107
- const tooltipPre = document . createElement ( "pre" ) ;
3108
- tooltipPre . appendChild ( tooltipCode ) ;
3109
- tooltip . RUSTDOC_TOOLTIP_DOM . appendChild ( tooltipPre ) ;
3110
- tooltip . typeWhereClause = whereClause ;
3111
- tooltip . innerText = "ⓘ" ;
3112
- tooltip . className = "tooltip" ;
3113
- window . rustdocConfigureTooltip ( tooltip ) ;
3114
- displayType . appendChild ( tooltip ) ;
3115
- displayType . appendChild ( document . createTextNode ( " " ) ) ;
3113
+ if ( tooltipCode . childNodes . length !== 0 ) {
3114
+ tooltip . RUSTDOC_TOOLTIP_DOM = document . createElement ( "div" ) ;
3115
+ tooltip . RUSTDOC_TOOLTIP_DOM . className = "content" ;
3116
+ const tooltipH3 = document . createElement ( "h3" ) ;
3117
+ tooltipH3 . innerHTML = "About this result" ;
3118
+ tooltip . RUSTDOC_TOOLTIP_DOM . appendChild ( tooltipH3 ) ;
3119
+ const tooltipPre = document . createElement ( "pre" ) ;
3120
+ tooltipPre . appendChild ( tooltipCode ) ;
3121
+ tooltip . RUSTDOC_TOOLTIP_DOM . appendChild ( tooltipPre ) ;
3122
+ tooltip . typeWhereClause = whereClause ;
3123
+ tooltip . innerText = "ⓘ" ;
3124
+ tooltip . className = "tooltip" ;
3125
+ window . rustdocConfigureTooltip ( tooltip ) ;
3126
+ displayType . appendChild ( tooltip ) ;
3127
+ displayType . appendChild ( document . createTextNode ( " " ) ) ;
3128
+ }
3116
3129
}
3117
3130
type . forEach ( ( value , index ) => {
3118
3131
if ( index % 2 !== 0 ) {
0 commit comments