Skip to content

Commit dbb978a

Browse files
committed
Remove unnecessary structhead parameter from render_union
`structhead` is used for `render_struct` so that the logic for rendering structs can be shared between struct variants and struct items. However, `render_union` is not used anywhere except for rendering union items, so its `structhead` parameter is unnecessary.
1 parent 9c25eb7 commit dbb978a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/librustdoc/html/render/print_item.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ fn item_union(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::Uni
888888
wrap_into_docblock(w, |w| {
889889
w.write_str("<pre class=\"rust union\">");
890890
render_attributes_in_pre(w, it, "");
891-
render_union(w, it, Some(&s.generics), &s.fields, "", true, cx);
891+
render_union(w, it, Some(&s.generics), &s.fields, "", cx);
892892
w.write_str("</pre>")
893893
});
894894

@@ -1380,14 +1380,12 @@ fn render_union(
13801380
g: Option<&clean::Generics>,
13811381
fields: &[clean::Item],
13821382
tab: &str,
1383-
structhead: bool,
13841383
cx: &Context<'_>,
13851384
) {
13861385
write!(
13871386
w,
1388-
"{}{}{}",
1387+
"{}union {}",
13891388
it.visibility.print_with_space(it.def_id, cx),
1390-
if structhead { "union " } else { "" },
13911389
it.name.as_ref().unwrap()
13921390
);
13931391
if let Some(g) = g {

0 commit comments

Comments
 (0)