about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2021-07-25 16:28:52 -0700
committerNoah Lev <camelidcamel@gmail.com>2021-07-25 16:28:52 -0700
commitdbb978a3c6d0503d188f11bbd4e53aac74d98bda (patch)
treeb250725633894c53206e1bff98e8a7cea05f7dc8 /src/librustdoc/html/render
parent9c25eb7aa3a71fb951564b0ddf131be59c2c951d (diff)
downloadrust-dbb978a3c6d0503d188f11bbd4e53aac74d98bda.tar.gz
rust-dbb978a3c6d0503d188f11bbd4e53aac74d98bda.zip
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.
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/print_item.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 2dfbaff1cc9..9d6e34caa07 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -888,7 +888,7 @@ fn item_union(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::Uni
     wrap_into_docblock(w, |w| {
         w.write_str("<pre class=\"rust union\">");
         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>")
     });
 
@@ -1380,14 +1380,12 @@ fn render_union(
     g: Option<&clean::Generics>,
     fields: &[clean::Item],
     tab: &str,
-    structhead: bool,
     cx: &Context<'_>,
 ) {
     write!(
         w,
-        "{}{}{}",
+        "{}union {}",
         it.visibility.print_with_space(it.def_id, cx),
-        if structhead { "union " } else { "" },
         it.name.as_ref().unwrap()
     );
     if let Some(g) = g {