@@ -2410,12 +2410,12 @@ fn item_function(w: &mut Buffer, cx: &Context, it: &clean::Item, f: &clean::Func
2410
2410
f. generics. print( )
2411
2411
)
2412
2412
. len ( ) ;
2413
- write ! ( w, "{} <pre class='rust fn'>" , render_spotlight_traits ( it ) ) ;
2413
+ write ! ( w, "<pre class='rust fn'>" ) ;
2414
2414
render_attributes ( w, it, false ) ;
2415
2415
write ! (
2416
2416
w,
2417
2417
"{vis}{constness}{asyncness}{unsafety}{abi}fn \
2418
- {name}{generics}{decl}{where_clause}</pre>",
2418
+ {name}{generics}{decl}{spotlight}{ where_clause}</pre>",
2419
2419
vis = it. visibility. print_with_space( ) ,
2420
2420
constness = f. header. constness. print_with_space( ) ,
2421
2421
asyncness = f. header. asyncness. print_with_space( ) ,
@@ -2425,7 +2425,8 @@ fn item_function(w: &mut Buffer, cx: &Context, it: &clean::Item, f: &clean::Func
2425
2425
generics = f. generics. print( ) ,
2426
2426
where_clause = WhereClause { gens: & f. generics, indent: 0 , end_newline: true } ,
2427
2427
decl = Function { decl: & f. decl, header_len, indent: 0 , asyncness: f. header. asyncness }
2428
- . print( )
2428
+ . print( ) ,
2429
+ spotlight = spotlight_decl( & f. decl) ,
2429
2430
) ;
2430
2431
document ( w, cx, it)
2431
2432
}
@@ -2614,9 +2615,8 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait)
2614
2615
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
2615
2616
write ! (
2616
2617
w,
2617
- "<h3 id='{id}' class='method'>{extra}<code>" ,
2618
- extra = render_spotlight_traits( m) ,
2619
- id = id
2618
+ "<h3 id='{id}' class='method'><code>" ,
2619
+ id = id,
2620
2620
) ;
2621
2621
render_assoc_item ( w, m, AssocItemLink :: Anchor ( Some ( & id) ) , ItemType :: Impl ) ;
2622
2622
write ! ( w, "</code>" ) ;
@@ -2931,7 +2931,7 @@ fn render_assoc_item(
2931
2931
write ! (
2932
2932
w,
2933
2933
"{}{}{}{}{}{}{}fn <a href='{href}' class='fnname'>{name}</a>\
2934
- {generics}{decl}{where_clause}",
2934
+ {generics}{decl}{spotlight}{ where_clause}",
2935
2935
if parent == ItemType :: Trait { " " } else { "" } ,
2936
2936
meth. visibility. print_with_space( ) ,
2937
2937
header. constness. print_with_space( ) ,
@@ -2943,6 +2943,7 @@ fn render_assoc_item(
2943
2943
name = name,
2944
2944
generics = g. print( ) ,
2945
2945
decl = Function { decl: d, header_len, indent, asyncness: header. asyncness } . print( ) ,
2946
+ spotlight = spotlight_decl( & d) ,
2946
2947
where_clause = WhereClause { gens: g, indent, end_newline }
2947
2948
)
2948
2949
}
@@ -3564,16 +3565,6 @@ fn should_render_item(item: &clean::Item, deref_mut_: bool) -> bool {
3564
3565
}
3565
3566
}
3566
3567
3567
- fn render_spotlight_traits ( item : & clean:: Item ) -> String {
3568
- match item. inner {
3569
- clean:: FunctionItem ( clean:: Function { ref decl, .. } )
3570
- | clean:: TyMethodItem ( clean:: TyMethod { ref decl, .. } )
3571
- | clean:: MethodItem ( clean:: Method { ref decl, .. } )
3572
- | clean:: ForeignFunctionItem ( clean:: Function { ref decl, .. } ) => spotlight_decl ( decl) ,
3573
- _ => String :: new ( ) ,
3574
- }
3575
- }
3576
-
3577
3568
fn spotlight_decl ( decl : & clean:: FnDecl ) -> String {
3578
3569
let mut out = Buffer :: html ( ) ;
3579
3570
let mut trait_ = String :: new ( ) ;
@@ -3622,13 +3613,13 @@ fn spotlight_decl(decl: &clean::FnDecl) -> String {
3622
3613
out. insert_str (
3623
3614
0 ,
3624
3615
& format ! (
3625
- "<div class=\" important-traits\" ><div class='tooltip'>ⓘ\
3616
+ "<span class=\" important-traits\" ><div class='tooltip'>ⓘ\
3626
3617
<span class='tooltiptext'>Important traits for {}</span></div>\
3627
3618
<div class=\" content hidden\" >",
3628
3619
trait_
3629
3620
) ,
3630
3621
) ;
3631
- out. push_str ( "</code></div></div >" ) ;
3622
+ out. push_str ( "</code></div></span >" ) ;
3632
3623
}
3633
3624
3634
3625
out. into_inner ( )
@@ -3740,13 +3731,12 @@ fn render_impl(
3740
3731
( true , " hidden" )
3741
3732
} ;
3742
3733
match item. inner {
3743
- clean:: MethodItem ( clean:: Method { ref decl , .. } )
3744
- | clean:: TyMethodItem ( clean:: TyMethod { ref decl , .. } ) => {
3734
+ clean:: MethodItem ( clean:: Method { .. } )
3735
+ | clean:: TyMethodItem ( clean:: TyMethod { .. } ) => {
3745
3736
// Only render when the method is not static or we allow static methods
3746
3737
if render_method_item {
3747
3738
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
3748
3739
write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ;
3749
- write ! ( w, "{}" , spotlight_decl( decl) ) ;
3750
3740
write ! ( w, "<code>" ) ;
3751
3741
render_assoc_item ( w, item, link. anchor ( & id) , ItemType :: Impl ) ;
3752
3742
write ! ( w, "</code>" ) ;
0 commit comments