Rollup merge of #87464 - camelid:rm-union-structhead, r=jyn514
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.
This commit is contained in:
commit
434223c632
1 changed files with 2 additions and 4 deletions
|
@ -888,7 +888,7 @@ fn item_union(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::Uni
|
||||||
wrap_into_docblock(w, |w| {
|
wrap_into_docblock(w, |w| {
|
||||||
w.write_str("<pre class=\"rust union\">");
|
w.write_str("<pre class=\"rust union\">");
|
||||||
render_attributes_in_pre(w, it, "");
|
render_attributes_in_pre(w, it, "");
|
||||||
render_union(w, it, Some(&s.generics), &s.fields, "", true, cx);
|
render_union(w, it, Some(&s.generics), &s.fields, "", cx);
|
||||||
w.write_str("</pre>")
|
w.write_str("</pre>")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1380,14 +1380,12 @@ fn render_union(
|
||||||
g: Option<&clean::Generics>,
|
g: Option<&clean::Generics>,
|
||||||
fields: &[clean::Item],
|
fields: &[clean::Item],
|
||||||
tab: &str,
|
tab: &str,
|
||||||
structhead: bool,
|
|
||||||
cx: &Context<'_>,
|
cx: &Context<'_>,
|
||||||
) {
|
) {
|
||||||
write!(
|
write!(
|
||||||
w,
|
w,
|
||||||
"{}{}{}",
|
"{}union {}",
|
||||||
it.visibility.print_with_space(it.def_id, cx),
|
it.visibility.print_with_space(it.def_id, cx),
|
||||||
if structhead { "union " } else { "" },
|
|
||||||
it.name.as_ref().unwrap()
|
it.name.as_ref().unwrap()
|
||||||
);
|
);
|
||||||
if let Some(g) = g {
|
if let Some(g) = g {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue