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