Skip to content

Commit a7329cd

Browse files
committedMay 27, 2023
Migrate to Askama
Fix formatting Fix CI
1 parent 917b0b6 commit a7329cd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
 

‎src/librustdoc/html/render/print_item.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -1556,21 +1556,23 @@ fn item_static(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
15561556
write!(w, "{}", document(cx, it, None, HeadingOffset::H2))
15571557
}
15581558

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());
15631564
write!(
1564-
w,
1565+
buffer,
15651566
" {}type {};\n}}",
15661567
visibility_print_with_space(it.visibility(cx.tcx()), it.item_id, cx),
15671568
it.name.unwrap(),
15681569
);
15691570
});
15701571

1571-
write!(w, "{}", document(cx, it, None, HeadingOffset::H2));
1572+
write!(w, "{}{}", buffer.into_inner(), document(cx, it, None, HeadingOffset::H2)).unwrap();
15721573

15731574
write!(w, "{}", render_assoc_items(cx, it, it.item_id.expect_def_id(), AssocItemRender::All))
1575+
.unwrap();
15741576
}
15751577

15761578
fn item_keyword(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item) {

0 commit comments

Comments
 (0)