@@ -1101,7 +1101,12 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
1101
1101
) ;
1102
1102
}
1103
1103
1104
- fn item_trait_alias ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , t : & clean:: TraitAlias ) {
1104
+ fn item_trait_alias (
1105
+ w : & mut impl fmt:: Write ,
1106
+ cx : & mut Context < ' _ > ,
1107
+ it : & clean:: Item ,
1108
+ t : & clean:: TraitAlias ,
1109
+ ) {
1105
1110
wrap_item ( w, |w| {
1106
1111
write ! (
1107
1112
w,
@@ -1111,16 +1116,17 @@ fn item_trait_alias(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &
1111
1116
print_where_clause( & t. generics, cx, 0 , Ending :: Newline ) ,
1112
1117
bounds( & t. bounds, true , cx) ,
1113
1118
attrs = render_attributes_in_pre( it, "" , cx. tcx( ) ) ,
1114
- ) ;
1119
+ )
1120
+ . unwrap ( ) ;
1115
1121
} ) ;
1116
1122
1117
- write ! ( w, "{}" , document( cx, it, None , HeadingOffset :: H2 ) ) ;
1118
-
1123
+ write ! ( w, "{}" , document( cx, it, None , HeadingOffset :: H2 ) ) . unwrap ( ) ;
1119
1124
// Render any items associated directly to this alias, as otherwise they
1120
1125
// won't be visible anywhere in the docs. It would be nice to also show
1121
1126
// associated items from the aliased type (see discussion in #32077), but
1122
1127
// we need #14072 to make sense of the generics.
1123
1128
write ! ( w, "{}" , render_assoc_items( cx, it, it. item_id. expect_def_id( ) , AssocItemRender :: All ) )
1129
+ . unwrap ( ) ;
1124
1130
}
1125
1131
1126
1132
fn item_opaque_ty ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , t : & clean:: OpaqueTy ) {
@@ -1673,13 +1679,14 @@ fn bounds(t_bounds: &[clean::GenericBound], trait_alias: bool, cx: &Context<'_>)
1673
1679
bounds
1674
1680
}
1675
1681
1676
- fn wrap_item < F > ( w : & mut Buffer , f : F )
1682
+ fn wrap_item < W , F > ( w : & mut W , f : F )
1677
1683
where
1678
- F : FnOnce ( & mut Buffer ) ,
1684
+ W : fmt:: Write ,
1685
+ F : FnOnce ( & mut W ) ,
1679
1686
{
1680
- w . write_str ( r#"<pre class="rust item-decl"><code>"# ) ;
1687
+ write ! ( w , r#"<pre class="rust item-decl"><code>"# ) . unwrap ( ) ;
1681
1688
f ( w) ;
1682
- w . write_str ( "</code></pre>" ) ;
1689
+ write ! ( w , "</code></pre>" ) . unwrap ( ) ;
1683
1690
}
1684
1691
1685
1692
#[ derive( PartialEq , Eq ) ]
0 commit comments