@@ -2324,7 +2324,7 @@ fn item_function(w: &mut Buffer, cx: &Context, it: &clean::Item, f: &clean::Func
2324
2324
f. generics. print( )
2325
2325
)
2326
2326
. len ( ) ;
2327
- write ! ( w, "{} <pre class='rust fn'>" , render_spotlight_traits ( it ) ) ;
2327
+ write ! ( w, "<pre class='rust fn'>" ) ;
2328
2328
render_attributes ( w, it, false ) ;
2329
2329
write ! (
2330
2330
w,
@@ -2527,13 +2527,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait)
2527
2527
let item_type = m. type_ ( ) ;
2528
2528
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
2529
2529
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) ;
2537
2531
render_assoc_item ( w, m, AssocItemLink :: Anchor ( Some ( & id) ) , ItemType :: Impl ) ;
2538
2532
write ! ( w, "</code>" ) ;
2539
2533
render_stability_since ( w, m, t) ;
@@ -3519,76 +3513,6 @@ fn should_render_item(item: &clean::Item, deref_mut_: bool) -> bool {
3519
3513
}
3520
3514
}
3521
3515
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
-
3592
3516
fn render_impl (
3593
3517
w : & mut Buffer ,
3594
3518
cx : & Context ,
@@ -3695,14 +3619,13 @@ fn render_impl(
3695
3619
( true , " hidden" )
3696
3620
} ;
3697
3621
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 { .. } ) => {
3700
3624
// Only render when the method is not static or we allow static methods
3701
3625
if render_method_item {
3702
3626
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
3703
3627
let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
3704
3628
write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ;
3705
- write ! ( w, "{}" , spotlight_decl( decl) ) ;
3706
3629
write ! ( w, "<code id='{}'>" , ns_id) ;
3707
3630
render_assoc_item ( w, item, link. anchor ( & id) , ItemType :: Impl ) ;
3708
3631
write ! ( w, "</code>" ) ;
0 commit comments