@@ -19,8 +19,8 @@ use super::{
1919 collect_paths_for_type, document, ensure_trailing_slash, get_filtered_impls_for_reference,
2020 item_ty_to_section, notable_traits_button, notable_traits_json, render_all_impls,
2121 render_assoc_item, render_assoc_items, render_attributes_in_code, render_attributes_in_pre,
22- render_impl, render_rightside, render_stability_since_raw, AssocItemLink , Context ,
23- ImplRenderingParameters ,
22+ render_impl, render_rightside, render_stability_since_raw,
23+ render_stability_since_raw_with_extra , AssocItemLink , Context , ImplRenderingParameters ,
2424} ;
2525use crate :: clean;
2626use crate :: config:: ModuleSorting ;
@@ -1267,30 +1267,30 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
12671267 document_non_exhaustive_header( it)
12681268 ) ;
12691269 document_non_exhaustive ( w, it) ;
1270+ write ! ( w, "<div class=\" variants\" >" ) ;
12701271 for variant in e. variants ( ) {
12711272 let id = cx. derive_id ( format ! ( "{}.{}" , ItemType :: Variant , variant. name. unwrap( ) ) ) ;
12721273 write ! (
12731274 w,
1274- "<h3 id=\" {id}\" class=\" variant small-section-header\" >\
1275- <a href=\" #{id}\" class=\" anchor field\" ></a>\
1276- <code>{name}",
1275+ "<section id=\" {id}\" class=\" variant\" >\
1276+ <a href=\" #{id}\" class=\" anchor\" ></a>",
12771277 id = id,
1278- name = variant. name. unwrap( )
12791278 ) ;
1280- if let clean:: VariantItem ( clean:: Variant :: Tuple ( ref s) ) = * variant. kind {
1281- w. write_str ( "(" ) ;
1282- print_tuple_struct_fields ( w, cx, s) ;
1283- w. write_str ( ")" ) ;
1284- }
1285- w. write_str ( "</code>" ) ;
1286- render_stability_since_raw (
1279+ render_stability_since_raw_with_extra (
12871280 w,
12881281 variant. stable_since ( tcx) ,
12891282 variant. const_stability ( tcx) ,
12901283 it. stable_since ( tcx) ,
12911284 it. const_stable_since ( tcx) ,
1285+ " rightside" ,
12921286 ) ;
1293- w. write_str ( "</h3>" ) ;
1287+ write ! ( w, "<h3 class=\" code-header\" >{name}" , name = variant. name. unwrap( ) ) ;
1288+ if let clean:: VariantItem ( clean:: Variant :: Tuple ( ref s) ) = * variant. kind {
1289+ w. write_str ( "(" ) ;
1290+ print_tuple_struct_fields ( w, cx, s) ;
1291+ w. write_str ( ")" ) ;
1292+ }
1293+ w. write_str ( "</h3></section>" ) ;
12941294
12951295 use crate :: clean:: Variant ;
12961296
@@ -1324,7 +1324,7 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
13241324 write ! (
13251325 w,
13261326 "<div class=\" sub-variant-field\" >\
1327- <span id=\" {id}\" class=\" variant small-section-header\" >\
1327+ <span id=\" {id}\" class=\" small-section-header\" >\
13281328 <a href=\" #{id}\" class=\" anchor field\" ></a>\
13291329 <code>{f}: {t}</code>\
13301330 </span>",
@@ -1343,6 +1343,7 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
13431343
13441344 document ( w, cx, variant, Some ( it) , HeadingOffset :: H4 ) ;
13451345 }
1346+ write ! ( w, "</div>" ) ;
13461347 }
13471348 let def_id = it. item_id . expect_def_id ( ) ;
13481349 render_assoc_items ( w, cx, it, def_id, AssocItemRender :: All ) ;
0 commit comments