@@ -2324,7 +2324,7 @@ fn item_function(w: &mut Buffer, cx: &Context, it: &clean::Item, f: &clean::Func
23242324 f. generics. print( )
23252325 )
23262326 . len ( ) ;
2327- write ! ( w, "{} <pre class='rust fn'>" , render_spotlight_traits ( it ) ) ;
2327+ write ! ( w, "<pre class='rust fn'>" ) ;
23282328 render_attributes ( w, it, false ) ;
23292329 write ! (
23302330 w,
@@ -2527,13 +2527,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait)
25272527 let item_type = m. type_ ( ) ;
25282528 let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
25292529 let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
2530- write ! (
2531- w,
2532- "<h3 id='{id}' class='method'>{extra}<code id='{ns_id}'>" ,
2533- extra = render_spotlight_traits( m) ,
2534- id = id,
2535- ns_id = ns_id
2536- ) ;
2530+ write ! ( w, "<h3 id='{id}' class='method'><code id='{ns_id}'>" , id = id, ns_id = ns_id) ;
25372531 render_assoc_item ( w, m, AssocItemLink :: Anchor ( Some ( & id) ) , ItemType :: Impl ) ;
25382532 write ! ( w, "</code>" ) ;
25392533 render_stability_since ( w, m, t) ;
@@ -3519,76 +3513,6 @@ fn should_render_item(item: &clean::Item, deref_mut_: bool) -> bool {
35193513 }
35203514}
35213515
3522- fn render_spotlight_traits ( item : & clean:: Item ) -> String {
3523- match item. inner {
3524- clean:: FunctionItem ( clean:: Function { ref decl, .. } )
3525- | clean:: TyMethodItem ( clean:: TyMethod { ref decl, .. } )
3526- | clean:: MethodItem ( clean:: Method { ref decl, .. } )
3527- | clean:: ForeignFunctionItem ( clean:: Function { ref decl, .. } ) => spotlight_decl ( decl) ,
3528- _ => String :: new ( ) ,
3529- }
3530- }
3531-
3532- fn spotlight_decl ( decl : & clean:: FnDecl ) -> String {
3533- let mut out = Buffer :: html ( ) ;
3534- let mut trait_ = String :: new ( ) ;
3535-
3536- if let Some ( did) = decl. output . def_id ( ) {
3537- let c = cache ( ) ;
3538- if let Some ( impls) = c. impls . get ( & did) {
3539- for i in impls {
3540- let impl_ = i. inner_impl ( ) ;
3541- if impl_. trait_ . def_id ( ) . map_or ( false , |d| c. traits [ & d] . is_spotlight ) {
3542- if out. is_empty ( ) {
3543- out. push_str ( & format ! (
3544- "<h3 class=\" important\" >Important traits for {}</h3>\
3545- <code class=\" content\" >",
3546- impl_. for_. print( )
3547- ) ) ;
3548- trait_. push_str ( & impl_. for_ . print ( ) . to_string ( ) ) ;
3549- }
3550-
3551- //use the "where" class here to make it small
3552- out. push_str ( & format ! (
3553- "<span class=\" where fmt-newline\" >{}</span>" ,
3554- impl_. print( )
3555- ) ) ;
3556- let t_did = impl_. trait_ . def_id ( ) . unwrap ( ) ;
3557- for it in & impl_. items {
3558- if let clean:: TypedefItem ( ref tydef, _) = it. inner {
3559- out. push_str ( "<span class=\" where fmt-newline\" > " ) ;
3560- assoc_type (
3561- & mut out,
3562- it,
3563- & [ ] ,
3564- Some ( & tydef. type_ ) ,
3565- AssocItemLink :: GotoSource ( t_did, & FxHashSet :: default ( ) ) ,
3566- "" ,
3567- ) ;
3568- out. push_str ( ";</span>" ) ;
3569- }
3570- }
3571- }
3572- }
3573- }
3574- }
3575-
3576- if !out. is_empty ( ) {
3577- out. insert_str (
3578- 0 ,
3579- & format ! (
3580- "<div class=\" important-traits\" ><div class='tooltip'>ⓘ\
3581- <span class='tooltiptext'>Important traits for {}</span></div>\
3582- <div class=\" content hidden\" >",
3583- trait_
3584- ) ,
3585- ) ;
3586- out. push_str ( "</code></div></div>" ) ;
3587- }
3588-
3589- out. into_inner ( )
3590- }
3591-
35923516fn render_impl (
35933517 w : & mut Buffer ,
35943518 cx : & Context ,
@@ -3695,14 +3619,13 @@ fn render_impl(
36953619 ( true , " hidden" )
36963620 } ;
36973621 match item. inner {
3698- clean:: MethodItem ( clean:: Method { ref decl , .. } )
3699- | clean:: TyMethodItem ( clean:: TyMethod { ref decl , .. } ) => {
3622+ clean:: MethodItem ( clean:: Method { .. } )
3623+ | clean:: TyMethodItem ( clean:: TyMethod { .. } ) => {
37003624 // Only render when the method is not static or we allow static methods
37013625 if render_method_item {
37023626 let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
37033627 let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
37043628 write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ;
3705- write ! ( w, "{}" , spotlight_decl( decl) ) ;
37063629 write ! ( w, "<code id='{}'>" , ns_id) ;
37073630 render_assoc_item ( w, item, link. anchor ( & id) , ItemType :: Impl ) ;
37083631 write ! ( w, "</code>" ) ;
0 commit comments