@@ -1556,21 +1556,23 @@ fn item_static(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
1556
1556
write ! ( w, "{}" , document( cx, it, None , HeadingOffset :: H2 ) )
1557
1557
}
1558
1558
1559
- fn item_foreign_type ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item ) {
1560
- wrap_item ( w, |w| {
1561
- w. write_str ( "extern {\n " ) ;
1562
- render_attributes_in_code ( w, it, cx. tcx ( ) ) ;
1559
+ fn item_foreign_type ( w : & mut impl fmt:: Write , cx : & mut Context < ' _ > , it : & clean:: Item ) {
1560
+ let mut buffer = Buffer :: new ( ) ;
1561
+ wrap_item ( & mut buffer, |buffer| {
1562
+ buffer. write_str ( "extern {\n " ) ;
1563
+ render_attributes_in_code ( buffer, it, cx. tcx ( ) ) ;
1563
1564
write ! (
1564
- w ,
1565
+ buffer ,
1565
1566
" {}type {};\n }}" ,
1566
1567
visibility_print_with_space( it. visibility( cx. tcx( ) ) , it. item_id, cx) ,
1567
1568
it. name. unwrap( ) ,
1568
1569
) ;
1569
1570
} ) ;
1570
1571
1571
- write ! ( w, "{}" , document( cx, it, None , HeadingOffset :: H2 ) ) ;
1572
+ write ! ( w, "{}{} " , buffer . into_inner ( ) , document( cx, it, None , HeadingOffset :: H2 ) ) . unwrap ( ) ;
1572
1573
1573
1574
write ! ( w, "{}" , render_assoc_items( cx, it, it. item_id. expect_def_id( ) , AssocItemRender :: All ) )
1575
+ . unwrap ( ) ;
1574
1576
}
1575
1577
1576
1578
fn item_keyword ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item ) {
0 commit comments