Skip to content

Commit

Permalink
Rollup merge of #107852 - notriddle:notriddle/rm-tab, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
rustdoc: remove unused fn parameter `tab`
  • Loading branch information
matthiaskrgr authored Feb 10, 2023
2 parents 8bfb97c + 792b846 commit d4d1c93
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/librustdoc/html/render/print_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ fn item_typedef(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clea
fn item_union(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean::Union) {
wrap_item(w, |w| {
render_attributes_in_pre(w, it, "");
render_union(w, it, Some(&s.generics), &s.fields, "", cx);
render_union(w, it, Some(&s.generics), &s.fields, cx);
});

document(w, cx, it, None, HeadingOffset::H2);
Expand Down Expand Up @@ -1628,7 +1628,6 @@ fn render_union(
it: &clean::Item,
g: Option<&clean::Generics>,
fields: &[clean::Item],
tab: &str,
cx: &Context<'_>,
) {
let tcx = cx.tcx();
Expand All @@ -1651,7 +1650,7 @@ fn render_union(
w.write_str(" ");
}

write!(w, "{{\n{}", tab);
write!(w, "{{\n");
let count_fields =
fields.iter().filter(|f| matches!(*f.kind, clean::StructFieldItem(..))).count();
let toggle = should_hide_fields(count_fields);
Expand All @@ -1663,17 +1662,16 @@ fn render_union(
if let clean::StructFieldItem(ref ty) = *field.kind {
write!(
w,
" {}{}: {},\n{}",
" {}{}: {},\n",
visibility_print_with_space(field.visibility(tcx), field.item_id, cx),
field.name.unwrap(),
ty.print(cx),
tab
ty.print(cx)
);
}
}

if it.has_stripped_entries().unwrap() {
write!(w, " /* private fields */\n{}", tab);
write!(w, " /* private fields */\n");
}
if toggle {
toggle_close(w);
Expand Down

0 comments on commit d4d1c93

Please sign in to comment.