Skip to content

Commit 6f48526

Browse files
Fix union fields display
1 parent 6fc0273 commit 6f48526

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/librustdoc/html/render/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,10 @@ fn document<'a, 'cx: 'a>(
421421
display_fn(move |f| {
422422
document_item_info(cx, item, parent).render_into(f).unwrap();
423423
if parent.is_none() {
424-
write!(f, "{}", document_full_collapsible(item, cx, heading_offset))?;
424+
write!(f, "{}", document_full_collapsible(item, cx, heading_offset))
425425
} else {
426-
write!(f, "{}", document_full(item, cx, heading_offset))?;
426+
write!(f, "{}", document_full(item, cx, heading_offset))
427427
}
428-
Ok(())
429428
})
430429
}
431430

src/librustdoc/html/templates/item_info.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% if !items.is_empty() %}
2-
<span class="item-info"> {# #}
2+
<span class="item-info">
33
{% for item in items %}
44
{{item|safe}} {# #}
55
{% endfor %}

src/librustdoc/html/templates/item_union.html

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
</code></pre>
55
{{ self.document() | safe }}
66
{% if self.fields_iter().peek().is_some() %}
7-
<h2 id="fields" class="fields small-section-header">
8-
Fields<a href="#fields" class="anchor">§</a>
7+
<h2 id="fields" class="fields small-section-header"> {# #}
8+
Fields<a href="#fields" class="anchor">§</a> {# #}
99
</h2>
1010
{% for (field, ty) in self.fields_iter() %}
1111
{% let name = field.name.expect("union field name") %}
12-
<span id="structfield.{{ name }}" class="{{ ItemType::StructField }} small-section-header">
13-
<a href="#structfield.{{ name }}" class="anchor field">§</a>
14-
<code>{{ name }}: {{ self.print_ty(ty) | safe }}</code>
12+
<span id="structfield.{{ name }}" {#+ #}
13+
class="{{ ItemType::StructField +}} small-section-header"> {# #}
14+
<a href="#structfield.{{ name }}" class="anchor field">§</a> {# #}
15+
<code>{{ name }}: {{+ self.print_ty(ty) | safe }}</code> {# #}
1516
</span>
1617
{% if let Some(stability_class) = self.stability_field(field) %}
1718
<span class="stab {{ stability_class }}"></span>

src/librustdoc/html/templates/print_item.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="main-heading"> {# #}
2-
<h1> {# #}
2+
<h1>
33
{{typ}}
44
{# The breadcrumbs of the item path, like std::string #}
55
{% for component in path_components %}
@@ -12,7 +12,7 @@ <h1> {# #}
1212
alt="Copy item path"> {# #}
1313
</button> {# #}
1414
</h1> {# #}
15-
<span class="out-of-band"> {# #}
15+
<span class="out-of-band">
1616
{% if !stability_since_raw.is_empty() %}
1717
{{ stability_since_raw|safe +}} · {#+ #}
1818
{% endif %}

0 commit comments

Comments
 (0)