Skip to content

Commit df98e3e

Browse files
committed
Fixed tests
1 parent 9078fd5 commit df98e3e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/librustdoc/html/render/print_item.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,18 +1542,23 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
15421542
}
15431543

15441544
fn item_static(w: &mut impl fmt::Write, cx: &mut Context<'_>, it: &clean::Item, s: &clean::Static) {
1545-
wrap_item(w, |w| {
1546-
render_attributes_in_code(w, it, cx.tcx());
1545+
1546+
let mut buffer = Buffer::new();
1547+
wrap_item(&mut buffer, |buffer| {
1548+
render_attributes_in_code(buffer, it, cx.tcx());
15471549
write!(
1548-
w,
1550+
buffer,
15491551
"{vis}static {mutability}{name}: {typ}",
15501552
vis = visibility_print_with_space(it.visibility(cx.tcx()), it.item_id, cx),
15511553
mutability = s.mutability.print_with_space(),
15521554
name = it.name.unwrap(),
15531555
typ = s.type_.print(cx)
15541556
);
15551557
});
1556-
write!(w, "{}", document(cx, it, None, HeadingOffset::H2))
1558+
1559+
write!(w, "{}", buffer.into_inner()).unwrap();
1560+
1561+
write!(w, "{}", document(cx, it, None, HeadingOffset::H2)).unwrap();
15571562
}
15581563

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

0 commit comments

Comments
 (0)