@@ -2247,18 +2247,22 @@ fn item_struct(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
22472247 } ) . peekable ( ) ;
22482248 if let doctree:: Plain = s. struct_type {
22492249 if fields. peek ( ) . is_some ( ) {
2250- write ! ( w, "<h2 class='fields'>Fields</h2>\n <table >" ) ?;
2250+ write ! ( w, "<h2 class='fields'>Fields</h2>\n <dl >" ) ?;
22512251 for field in fields {
2252- write ! ( w, "<tr class='stab {stab}'>
2253- <td id='{shortty}.{name}'>\
2254- <code>{name}</code></td><td>",
2252+ write ! ( w, "<dt class='stab {stab}' id='{shortty}.{name}'>\
2253+ <code>{name}",
22552254 shortty = ItemType :: StructField ,
22562255 stab = field. stability_class( ) ,
22572256 name = field. name. as_ref( ) . unwrap( ) ) ?;
2257+ if let clean:: StructFieldItem ( ref ty) = field. inner {
2258+ write ! ( w, ": {}</code></dt><dd>" , ty) ?;
2259+ } else {
2260+ write ! ( w, "</code></dt><dd>" ) ?;
2261+ }
22582262 document ( w, cx, field) ?;
2259- write ! ( w, "</td></tr >" ) ?;
2263+ write ! ( w, "</dd >" ) ?;
22602264 }
2261- write ! ( w, "</table >" ) ?;
2265+ write ! ( w, "</dl >" ) ?;
22622266 }
22632267 }
22642268 render_assoc_items ( w, cx, it, it. def_id , AssocItemRender :: All )
@@ -2336,18 +2340,22 @@ fn item_enum(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
23362340 }
23372341 } ) ;
23382342 write ! ( w, "<h3 class='fields'>Fields</h3>\n
2339- <table >" ) ?;
2343+ <dl >" ) ?;
23402344 for field in fields {
2341- write ! ( w, "<tr><td \
2342- id='{shortty}.{v}.field.{f}'>\
2343- <code>{f}</code></td><td>",
2345+ write ! ( w, "<dt id='{shortty}.{v}.field.{f}'>\
2346+ <code>{f}",
23442347 shortty = ItemType :: Variant ,
23452348 v = variant. name. as_ref( ) . unwrap( ) ,
23462349 f = field. name. as_ref( ) . unwrap( ) ) ?;
2350+ if let clean:: StructFieldItem ( ref ty) = field. inner {
2351+ write ! ( w, ": {}</code></dt><dd>" , ty) ?;
2352+ } else {
2353+ write ! ( w, "</code></dt><dd>" ) ?;
2354+ }
23472355 document ( w, cx, field) ?;
2348- write ! ( w, "</td></tr >" ) ?;
2356+ write ! ( w, "</dd >" ) ?;
23492357 }
2350- write ! ( w, "</table >" ) ?;
2358+ write ! ( w, "</dl >" ) ?;
23512359 }
23522360 write ! ( w, "</td><td>" ) ?;
23532361 render_stability_since ( w, variant, it) ?;
0 commit comments