@@ -2384,12 +2384,12 @@ fn item_function(w: &mut Buffer, cx: &Context, it: &clean::Item, f: &clean::Func
23842384 f. generics. print( )
23852385 )
23862386 . len ( ) ;
2387- write ! ( w, "{} <pre class='rust fn'>" , render_spotlight_traits ( it ) ) ;
2387+ write ! ( w, "<pre class='rust fn'>" ) ;
23882388 render_attributes ( w, it, false ) ;
23892389 write ! (
23902390 w,
23912391 "{vis}{constness}{asyncness}{unsafety}{abi}fn \
2392- {name}{generics}{decl}{where_clause}</pre>",
2392+ {name}{generics}{decl}{spotlight}{ where_clause}</pre>",
23932393 vis = it. visibility. print_with_space( ) ,
23942394 constness = f. header. constness. print_with_space( ) ,
23952395 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
23992399 generics = f. generics. print( ) ,
24002400 where_clause = WhereClause { gens: & f. generics, indent: 0 , end_newline: true } ,
24012401 decl = Function { decl: & f. decl, header_len, indent: 0 , asyncness: f. header. asyncness }
2402- . print( )
2402+ . print( ) ,
2403+ spotlight = spotlight_decl( & f. decl) ,
24032404 ) ;
24042405 document ( w, cx, it)
24052406}
@@ -2589,8 +2590,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait)
25892590 let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
25902591 write ! (
25912592 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}'>" ,
25942594 id = id,
25952595 ns_id = ns_id
25962596 ) ;
@@ -2907,7 +2907,7 @@ fn render_assoc_item(
29072907 write ! (
29082908 w,
29092909 "{}{}{}{}{}{}{}fn <a href='{href}' class='fnname'>{name}</a>\
2910- {generics}{decl}{where_clause}",
2910+ {generics}{decl}{spotlight}{ where_clause}",
29112911 if parent == ItemType :: Trait { " " } else { "" } ,
29122912 meth. visibility. print_with_space( ) ,
29132913 header. constness. print_with_space( ) ,
@@ -2919,6 +2919,7 @@ fn render_assoc_item(
29192919 name = name,
29202920 generics = g. print( ) ,
29212921 decl = Function { decl: d, header_len, indent, asyncness: header. asyncness } . print( ) ,
2922+ spotlight = spotlight_decl( & d) ,
29222923 where_clause = WhereClause { gens: g, indent, end_newline }
29232924 )
29242925 }
@@ -3556,16 +3557,6 @@ fn should_render_item(item: &clean::Item, deref_mut_: bool) -> bool {
35563557 }
35573558}
35583559
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-
35693560fn spotlight_decl ( decl : & clean:: FnDecl ) -> String {
35703561 let mut out = Buffer :: html ( ) ;
35713562 let mut trait_ = String :: new ( ) ;
@@ -3614,13 +3605,13 @@ fn spotlight_decl(decl: &clean::FnDecl) -> String {
36143605 out. insert_str (
36153606 0 ,
36163607 & format ! (
3617- "<div class=\" important-traits\" ><div class='tooltip'>ⓘ\
3608+ "<span class=\" important-traits\" ><div class='tooltip'>ⓘ\
36183609 <span class='tooltiptext'>Important traits for {}</span></div>\
36193610 <div class=\" content hidden\" >",
36203611 trait_
36213612 ) ,
36223613 ) ;
3623- out. push_str ( "</code></div></div >" ) ;
3614+ out. push_str ( "</code></div></span >" ) ;
36243615 }
36253616
36263617 out. into_inner ( )
@@ -3732,14 +3723,13 @@ fn render_impl(
37323723 ( true , " hidden" )
37333724 } ;
37343725 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 { .. } ) => {
37373728 // Only render when the method is not static or we allow static methods
37383729 if render_method_item {
37393730 let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
37403731 let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
37413732 write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ;
3742- write ! ( w, "{}" , spotlight_decl( decl) ) ;
37433733 write ! ( w, "<code id='{}'>" , ns_id) ;
37443734 render_assoc_item ( w, item, link. anchor ( & id) , ItemType :: Impl ) ;
37453735 write ! ( w, "</code>" ) ;
0 commit comments