@@ -2325,7 +2325,7 @@ fn item_function(w: &mut Buffer, cx: &Context, it: &clean::Item, f: &clean::Func
2325
2325
f. generics. print( )
2326
2326
)
2327
2327
. len ( ) ;
2328
- write ! ( w, "{} <pre class='rust fn'>" , render_spotlight_traits ( it ) ) ;
2328
+ write ! ( w, "<pre class='rust fn'>" ) ;
2329
2329
render_attributes ( w, it, false ) ;
2330
2330
write ! (
2331
2331
w,
@@ -2528,13 +2528,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait)
2528
2528
let item_type = m. type_ ( ) ;
2529
2529
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
2530
2530
let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
2531
- write ! (
2532
- w,
2533
- "<h3 id='{id}' class='method'>{extra}<code id='{ns_id}'>" ,
2534
- extra = render_spotlight_traits( m) ,
2535
- id = id,
2536
- ns_id = ns_id
2537
- ) ;
2531
+ write ! ( w, "<h3 id='{id}' class='method'><code id='{ns_id}'>" , id = id, ns_id = ns_id) ;
2538
2532
render_assoc_item ( w, m, AssocItemLink :: Anchor ( Some ( & id) ) , ItemType :: Impl ) ;
2539
2533
write ! ( w, "</code>" ) ;
2540
2534
render_stability_since ( w, m, t) ;
@@ -3520,76 +3514,6 @@ fn should_render_item(item: &clean::Item, deref_mut_: bool) -> bool {
3520
3514
}
3521
3515
}
3522
3516
3523
- fn render_spotlight_traits ( item : & clean:: Item ) -> String {
3524
- match item. inner {
3525
- clean:: FunctionItem ( clean:: Function { ref decl, .. } )
3526
- | clean:: TyMethodItem ( clean:: TyMethod { ref decl, .. } )
3527
- | clean:: MethodItem ( clean:: Method { ref decl, .. } )
3528
- | clean:: ForeignFunctionItem ( clean:: Function { ref decl, .. } ) => spotlight_decl ( decl) ,
3529
- _ => String :: new ( ) ,
3530
- }
3531
- }
3532
-
3533
- fn spotlight_decl ( decl : & clean:: FnDecl ) -> String {
3534
- let mut out = Buffer :: html ( ) ;
3535
- let mut trait_ = String :: new ( ) ;
3536
-
3537
- if let Some ( did) = decl. output . def_id ( ) {
3538
- let c = cache ( ) ;
3539
- if let Some ( impls) = c. impls . get ( & did) {
3540
- for i in impls {
3541
- let impl_ = i. inner_impl ( ) ;
3542
- if impl_. trait_ . def_id ( ) . map_or ( false , |d| c. traits [ & d] . is_spotlight ) {
3543
- if out. is_empty ( ) {
3544
- out. push_str ( & format ! (
3545
- "<h3 class=\" important\" >Important traits for {}</h3>\
3546
- <code class=\" content\" >",
3547
- impl_. for_. print( )
3548
- ) ) ;
3549
- trait_. push_str ( & impl_. for_ . print ( ) . to_string ( ) ) ;
3550
- }
3551
-
3552
- //use the "where" class here to make it small
3553
- out. push_str ( & format ! (
3554
- "<span class=\" where fmt-newline\" >{}</span>" ,
3555
- impl_. print( )
3556
- ) ) ;
3557
- let t_did = impl_. trait_ . def_id ( ) . unwrap ( ) ;
3558
- for it in & impl_. items {
3559
- if let clean:: TypedefItem ( ref tydef, _) = it. inner {
3560
- out. push_str ( "<span class=\" where fmt-newline\" > " ) ;
3561
- assoc_type (
3562
- & mut out,
3563
- it,
3564
- & [ ] ,
3565
- Some ( & tydef. type_ ) ,
3566
- AssocItemLink :: GotoSource ( t_did, & FxHashSet :: default ( ) ) ,
3567
- "" ,
3568
- ) ;
3569
- out. push_str ( ";</span>" ) ;
3570
- }
3571
- }
3572
- }
3573
- }
3574
- }
3575
- }
3576
-
3577
- if !out. is_empty ( ) {
3578
- out. insert_str (
3579
- 0 ,
3580
- & format ! (
3581
- "<div class=\" important-traits\" ><div class='tooltip'>ⓘ\
3582
- <span class='tooltiptext'>Important traits for {}</span></div>\
3583
- <div class=\" content hidden\" >",
3584
- trait_
3585
- ) ,
3586
- ) ;
3587
- out. push_str ( "</code></div></div>" ) ;
3588
- }
3589
-
3590
- out. into_inner ( )
3591
- }
3592
-
3593
3517
fn render_impl (
3594
3518
w : & mut Buffer ,
3595
3519
cx : & Context ,
@@ -3696,14 +3620,13 @@ fn render_impl(
3696
3620
( true , " hidden" )
3697
3621
} ;
3698
3622
match item. inner {
3699
- clean:: MethodItem ( clean:: Method { ref decl , .. } )
3700
- | clean:: TyMethodItem ( clean:: TyMethod { ref decl , .. } ) => {
3623
+ clean:: MethodItem ( clean:: Method { .. } )
3624
+ | clean:: TyMethodItem ( clean:: TyMethod { .. } ) => {
3701
3625
// Only render when the method is not static or we allow static methods
3702
3626
if render_method_item {
3703
3627
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
3704
3628
let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
3705
3629
write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ;
3706
- write ! ( w, "{}" , spotlight_decl( decl) ) ;
3707
3630
write ! ( w, "<code id='{}'>" , ns_id) ;
3708
3631
render_assoc_item ( w, item, link. anchor ( & id) , ItemType :: Impl ) ;
3709
3632
write ! ( w, "</code>" ) ;
0 commit comments