@@ -86,11 +86,7 @@ crate type NameDoc = (String, Option<String>);
86
86
87
87
crate fn ensure_trailing_slash ( v : & str ) -> impl fmt:: Display + ' _ {
88
88
crate :: html:: format:: display_fn ( move |f| {
89
- if !v. ends_with ( '/' ) && !v. is_empty ( ) {
90
- write ! ( f, "{}/" , v)
91
- } else {
92
- write ! ( f, "{}" , v)
93
- }
89
+ if !v. ends_with ( '/' ) && !v. is_empty ( ) { write ! ( f, "{}/" , v) } else { write ! ( f, "{}" , v) }
94
90
} )
95
91
}
96
92
@@ -1950,11 +1946,7 @@ fn document_stability(
1950
1946
}
1951
1947
1952
1948
fn document_non_exhaustive_header ( item : & clean:: Item ) -> & str {
1953
- if item. is_non_exhaustive ( ) {
1954
- " (Non-exhaustive)"
1955
- } else {
1956
- ""
1957
- }
1949
+ if item. is_non_exhaustive ( ) { " (Non-exhaustive)" } else { "" }
1958
1950
}
1959
1951
1960
1952
fn document_non_exhaustive ( w : & mut Buffer , item : & clean:: Item ) {
@@ -2636,7 +2628,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait,
2636
2628
write ! ( w, "{}<span class=\" loading-content\" >Loading content...</span>" , extra_content)
2637
2629
}
2638
2630
2639
- fn trait_item ( w : & mut Buffer , cx : & Context , m : & clean:: Item , t : & clean:: Item ) {
2631
+ fn trait_item ( w : & mut Buffer , cx : & Context , m : & clean:: Item , t : & clean:: Item , cache : & Cache ) {
2640
2632
let name = m. name . as_ref ( ) . unwrap ( ) ;
2641
2633
info ! ( "Documenting {} on {}" , name, t. name. as_deref( ) . unwrap_or_default( ) ) ;
2642
2634
let item_type = m. type_ ( ) ;
@@ -2645,6 +2637,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait,
2645
2637
render_assoc_item ( w, m, AssocItemLink :: Anchor ( Some ( & id) ) , ItemType :: Impl ) ;
2646
2638
write ! ( w, "</code>" ) ;
2647
2639
render_stability_since ( w, m, t) ;
2640
+ write_srclink ( cx, m, w, cache) ;
2648
2641
write ! ( w, "</h3>" ) ;
2649
2642
document ( w, cx, m, Some ( t) ) ;
2650
2643
}
@@ -2656,8 +2649,8 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait,
2656
2649
"Associated Types" ,
2657
2650
"<div class=\" methods\" >" ,
2658
2651
) ;
2659
- for t in & types {
2660
- trait_item ( w, cx, * t, it) ;
2652
+ for t in types {
2653
+ trait_item ( w, cx, t, it, cache ) ;
2661
2654
}
2662
2655
write_loading_content ( w, "</div>" ) ;
2663
2656
}
@@ -2669,8 +2662,8 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait,
2669
2662
"Associated Constants" ,
2670
2663
"<div class=\" methods\" >" ,
2671
2664
) ;
2672
- for t in & consts {
2673
- trait_item ( w, cx, * t, it) ;
2665
+ for t in consts {
2666
+ trait_item ( w, cx, t, it, cache ) ;
2674
2667
}
2675
2668
write_loading_content ( w, "</div>" ) ;
2676
2669
}
@@ -2683,8 +2676,8 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait,
2683
2676
"Required methods" ,
2684
2677
"<div class=\" methods\" >" ,
2685
2678
) ;
2686
- for m in & required {
2687
- trait_item ( w, cx, * m, it) ;
2679
+ for m in required {
2680
+ trait_item ( w, cx, m, it, cache ) ;
2688
2681
}
2689
2682
write_loading_content ( w, "</div>" ) ;
2690
2683
}
@@ -2695,8 +2688,8 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait,
2695
2688
"Provided methods" ,
2696
2689
"<div class=\" methods\" >" ,
2697
2690
) ;
2698
- for m in & provided {
2699
- trait_item ( w, cx, * m, it) ;
2691
+ for m in provided {
2692
+ trait_item ( w, cx, m, it, cache ) ;
2700
2693
}
2701
2694
write_loading_content ( w, "</div>" ) ;
2702
2695
}
0 commit comments