@@ -2384,12 +2384,12 @@ fn item_function(w: &mut Buffer, cx: &Context, it: &clean::Item, f: &clean::Func
2384
2384
f. generics. print( )
2385
2385
)
2386
2386
. len ( ) ;
2387
- write ! ( w, "{} <pre class='rust fn'>" , render_spotlight_traits ( it ) ) ;
2387
+ write ! ( w, "<pre class='rust fn'>" ) ;
2388
2388
render_attributes ( w, it, false ) ;
2389
2389
write ! (
2390
2390
w,
2391
2391
"{vis}{constness}{asyncness}{unsafety}{abi}fn \
2392
- {name}{generics}{decl}{where_clause}</pre>",
2392
+ {name}{generics}{decl}{spotlight}{ where_clause}</pre>",
2393
2393
vis = it. visibility. print_with_space( ) ,
2394
2394
constness = f. header. constness. print_with_space( ) ,
2395
2395
asyncness = f. header. asyncness. print_with_space( ) ,
@@ -2399,7 +2399,8 @@ fn item_function(w: &mut Buffer, cx: &Context, it: &clean::Item, f: &clean::Func
2399
2399
generics = f. generics. print( ) ,
2400
2400
where_clause = WhereClause { gens: & f. generics, indent: 0 , end_newline: true } ,
2401
2401
decl = Function { decl: & f. decl, header_len, indent: 0 , asyncness: f. header. asyncness }
2402
- . print( )
2402
+ . print( ) ,
2403
+ spotlight = spotlight_decl( & f. decl) ,
2403
2404
) ;
2404
2405
document ( w, cx, it)
2405
2406
}
@@ -2589,8 +2590,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait)
2589
2590
let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
2590
2591
write ! (
2591
2592
w,
2592
- "<h3 id='{id}' class='method'>{extra}<code id='{ns_id}'>" ,
2593
- extra = render_spotlight_traits( m) ,
2593
+ "<h3 id='{id}' class='method'><code id='{ns_id}'>" ,
2594
2594
id = id,
2595
2595
ns_id = ns_id
2596
2596
) ;
@@ -2907,7 +2907,7 @@ fn render_assoc_item(
2907
2907
write ! (
2908
2908
w,
2909
2909
"{}{}{}{}{}{}{}fn <a href='{href}' class='fnname'>{name}</a>\
2910
- {generics}{decl}{where_clause}",
2910
+ {generics}{decl}{spotlight}{ where_clause}",
2911
2911
if parent == ItemType :: Trait { " " } else { "" } ,
2912
2912
meth. visibility. print_with_space( ) ,
2913
2913
header. constness. print_with_space( ) ,
@@ -2919,6 +2919,7 @@ fn render_assoc_item(
2919
2919
name = name,
2920
2920
generics = g. print( ) ,
2921
2921
decl = Function { decl: d, header_len, indent, asyncness: header. asyncness } . print( ) ,
2922
+ spotlight = spotlight_decl( & d) ,
2922
2923
where_clause = WhereClause { gens: g, indent, end_newline }
2923
2924
)
2924
2925
}
@@ -3556,16 +3557,6 @@ fn should_render_item(item: &clean::Item, deref_mut_: bool) -> bool {
3556
3557
}
3557
3558
}
3558
3559
3559
- fn render_spotlight_traits ( item : & clean:: Item ) -> String {
3560
- match item. inner {
3561
- clean:: FunctionItem ( clean:: Function { ref decl, .. } )
3562
- | clean:: TyMethodItem ( clean:: TyMethod { ref decl, .. } )
3563
- | clean:: MethodItem ( clean:: Method { ref decl, .. } )
3564
- | clean:: ForeignFunctionItem ( clean:: Function { ref decl, .. } ) => spotlight_decl ( decl) ,
3565
- _ => String :: new ( ) ,
3566
- }
3567
- }
3568
-
3569
3560
fn spotlight_decl ( decl : & clean:: FnDecl ) -> String {
3570
3561
let mut out = Buffer :: html ( ) ;
3571
3562
let mut trait_ = String :: new ( ) ;
@@ -3614,13 +3605,13 @@ fn spotlight_decl(decl: &clean::FnDecl) -> String {
3614
3605
out. insert_str (
3615
3606
0 ,
3616
3607
& format ! (
3617
- "<div class=\" important-traits\" ><div class='tooltip'>ⓘ\
3608
+ "<span class=\" important-traits\" ><div class='tooltip'>ⓘ\
3618
3609
<span class='tooltiptext'>Important traits for {}</span></div>\
3619
3610
<div class=\" content hidden\" >",
3620
3611
trait_
3621
3612
) ,
3622
3613
) ;
3623
- out. push_str ( "</code></div></div >" ) ;
3614
+ out. push_str ( "</code></div></span >" ) ;
3624
3615
}
3625
3616
3626
3617
out. into_inner ( )
@@ -3732,14 +3723,13 @@ fn render_impl(
3732
3723
( true , " hidden" )
3733
3724
} ;
3734
3725
match item. inner {
3735
- clean:: MethodItem ( clean:: Method { ref decl , .. } )
3736
- | clean:: TyMethodItem ( clean:: TyMethod { ref decl , .. } ) => {
3726
+ clean:: MethodItem ( clean:: Method { .. } )
3727
+ | clean:: TyMethodItem ( clean:: TyMethod { .. } ) => {
3737
3728
// Only render when the method is not static or we allow static methods
3738
3729
if render_method_item {
3739
3730
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
3740
3731
let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
3741
3732
write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ;
3742
- write ! ( w, "{}" , spotlight_decl( decl) ) ;
3743
3733
write ! ( w, "<code id='{}'>" , ns_id) ;
3744
3734
render_assoc_item ( w, item, link. anchor ( & id) , ItemType :: Impl ) ;
3745
3735
write ! ( w, "</code>" ) ;
0 commit comments