Rollup merge of #49516 - GuillaumeGomez:add-union-field-missing-anchor, r=QuietMisdreavus
Add missing anchor for union type fields r? @QuietMisdreavus
This commit is contained in:
commit
e0c180362e
@ -2815,10 +2815,15 @@ fn item_union(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
|
||||
write!(w, "<h2 id='fields' class='fields small-section-header'>
|
||||
Fields<a href='#fields' class='anchor'></a></h2>")?;
|
||||
for (field, ty) in fields {
|
||||
write!(w, "<span id='{shortty}.{name}' class=\"{shortty}\"><code>{name}: {ty}</code>
|
||||
let name = field.name.as_ref().expect("union field name");
|
||||
let id = format!("{}.{}", ItemType::StructField, name);
|
||||
write!(w, "<span id=\"{id}\" class=\"{shortty} small-section-header\">\
|
||||
<a href=\"#{id}\" class=\"anchor field\"></a>\
|
||||
<span class='invisible'><code>{name}: {ty}</code></span>\
|
||||
</span>",
|
||||
id = id,
|
||||
name = name,
|
||||
shortty = ItemType::StructField,
|
||||
name = field.name.as_ref().unwrap(),
|
||||
ty = ty)?;
|
||||
if let Some(stability_class) = field.stability_class() {
|
||||
write!(w, "<span class='stab {stab}'></span>",
|
||||
|
Loading…
Reference in New Issue
Block a user