Fixed tests

This commit is contained in:
sladynnunes 2023-05-26 02:22:00 -07:00
parent 9078fd51d6
commit df98e3e6ec

View File

@ -1542,10 +1542,12 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
}
fn item_static(w: &mut impl fmt::Write, cx: &mut Context<'_>, it: &clean::Item, s: &clean::Static) {
wrap_item(w, |w| {
render_attributes_in_code(w, it, cx.tcx());
let mut buffer = Buffer::new();
wrap_item(&mut buffer, |buffer| {
render_attributes_in_code(buffer, it, cx.tcx());
write!(
w,
buffer,
"{vis}static {mutability}{name}: {typ}",
vis = visibility_print_with_space(it.visibility(cx.tcx()), it.item_id, cx),
mutability = s.mutability.print_with_space(),
@ -1553,7 +1555,10 @@ fn item_static(w: &mut impl fmt::Write, cx: &mut Context<'_>, it: &clean::Item,
typ = s.type_.print(cx)
);
});
write!(w, "{}", document(cx, it, None, HeadingOffset::H2))
write!(w, "{}", buffer.into_inner()).unwrap();
write!(w, "{}", document(cx, it, None, HeadingOffset::H2)).unwrap();
}
fn item_foreign_type(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item) {