@@ -2410,12 +2410,12 @@ fn item_function(w: &mut Buffer, cx: &Context, it: &clean::Item, f: &clean::Func
24102410 f. generics. print( )
24112411 )
24122412 . len ( ) ;
2413- write ! ( w, "{} <pre class='rust fn'>" , render_spotlight_traits ( it ) ) ;
2413+ write ! ( w, "<pre class='rust fn'>" ) ;
24142414 render_attributes ( w, it, false ) ;
24152415 write ! (
24162416 w,
24172417 "{vis}{constness}{asyncness}{unsafety}{abi}fn \
2418- {name}{generics}{decl}{where_clause}</pre>",
2418+ {name}{generics}{decl}{spotlight}{ where_clause}</pre>",
24192419 vis = it. visibility. print_with_space( ) ,
24202420 constness = f. header. constness. print_with_space( ) ,
24212421 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
24252425 generics = f. generics. print( ) ,
24262426 where_clause = WhereClause { gens: & f. generics, indent: 0 , end_newline: true } ,
24272427 decl = Function { decl: & f. decl, header_len, indent: 0 , asyncness: f. header. asyncness }
2428- . print( )
2428+ . print( ) ,
2429+ spotlight = spotlight_decl( & f. decl) ,
24292430 ) ;
24302431 document ( w, cx, it)
24312432}
@@ -2614,9 +2615,8 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait)
26142615 let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
26152616 write ! (
26162617 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,
26202620 ) ;
26212621 render_assoc_item ( w, m, AssocItemLink :: Anchor ( Some ( & id) ) , ItemType :: Impl ) ;
26222622 write ! ( w, "</code>" ) ;
@@ -2931,7 +2931,7 @@ fn render_assoc_item(
29312931 write ! (
29322932 w,
29332933 "{}{}{}{}{}{}{}fn <a href='{href}' class='fnname'>{name}</a>\
2934- {generics}{decl}{where_clause}",
2934+ {generics}{decl}{spotlight}{ where_clause}",
29352935 if parent == ItemType :: Trait { " " } else { "" } ,
29362936 meth. visibility. print_with_space( ) ,
29372937 header. constness. print_with_space( ) ,
@@ -2943,6 +2943,7 @@ fn render_assoc_item(
29432943 name = name,
29442944 generics = g. print( ) ,
29452945 decl = Function { decl: d, header_len, indent, asyncness: header. asyncness } . print( ) ,
2946+ spotlight = spotlight_decl( & d) ,
29462947 where_clause = WhereClause { gens: g, indent, end_newline }
29472948 )
29482949 }
@@ -3564,16 +3565,6 @@ fn should_render_item(item: &clean::Item, deref_mut_: bool) -> bool {
35643565 }
35653566}
35663567
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-
35773568fn spotlight_decl ( decl : & clean:: FnDecl ) -> String {
35783569 let mut out = Buffer :: html ( ) ;
35793570 let mut trait_ = String :: new ( ) ;
@@ -3622,13 +3613,13 @@ fn spotlight_decl(decl: &clean::FnDecl) -> String {
36223613 out. insert_str (
36233614 0 ,
36243615 & format ! (
3625- "<div class=\" important-traits\" ><div class='tooltip'>ⓘ\
3616+ "<span class=\" important-traits\" ><div class='tooltip'>ⓘ\
36263617 <span class='tooltiptext'>Important traits for {}</span></div>\
36273618 <div class=\" content hidden\" >",
36283619 trait_
36293620 ) ,
36303621 ) ;
3631- out. push_str ( "</code></div></div >" ) ;
3622+ out. push_str ( "</code></div></span >" ) ;
36323623 }
36333624
36343625 out. into_inner ( )
@@ -3740,13 +3731,12 @@ fn render_impl(
37403731 ( true , " hidden" )
37413732 } ;
37423733 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 { .. } ) => {
37453736 // Only render when the method is not static or we allow static methods
37463737 if render_method_item {
37473738 let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
37483739 write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ;
3749- write ! ( w, "{}" , spotlight_decl( decl) ) ;
37503740 write ! ( w, "<code>" ) ;
37513741 render_assoc_item ( w, item, link. anchor ( & id) , ItemType :: Impl ) ;
37523742 write ! ( w, "</code>" ) ;
0 commit comments