@@ -1081,10 +1081,10 @@ fn item_typedef(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clea
1081
1081
fn write_content ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , t : & clean:: Typedef ) {
1082
1082
wrap_item ( w, |w| {
1083
1083
render_attributes_in_pre ( w, it, "" ) ;
1084
- write ! ( w, "{}" , visibility_print_with_space( it. visibility( cx. tcx( ) ) , it. item_id, cx) ) ;
1085
1084
write ! (
1086
1085
w,
1087
- "type {}{}{where_clause} = {type_};" ,
1086
+ "{}type {}{}{where_clause} = {type_};" ,
1087
+ visibility_print_with_space( it. visibility( cx. tcx( ) ) , it. item_id, cx) ,
1088
1088
it. name. unwrap( ) ,
1089
1089
t. generics. print( cx) ,
1090
1090
where_clause = print_where_clause( & t. generics, cx, 0 , Ending :: Newline ) ,
@@ -1138,13 +1138,11 @@ fn item_union(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean:
1138
1138
<a href=\" #{id}\" class=\" anchor field\" >§</a>\
1139
1139
<code>{name}: {ty}</code>\
1140
1140
</span>",
1141
- id = id,
1142
- name = name,
1143
1141
shortty = ItemType :: StructField ,
1144
1142
ty = ty. print( cx) ,
1145
1143
) ;
1146
1144
if let Some ( stability_class) = field. stability_class ( cx. tcx ( ) ) {
1147
- write ! ( w, "<span class=\" stab {stab }\" ></span>" , stab = stability_class ) ;
1145
+ write ! ( w, "<span class=\" stab {stability_class }\" ></span>" ) ;
1148
1146
}
1149
1147
document ( w, cx, field, Some ( it) , HeadingOffset :: H3 ) ;
1150
1148
}
@@ -1242,7 +1240,6 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
1242
1240
w,
1243
1241
"<section id=\" {id}\" class=\" variant\" >\
1244
1242
<a href=\" #{id}\" class=\" anchor\" >§</a>",
1245
- id = id,
1246
1243
) ;
1247
1244
render_stability_since_raw_with_extra (
1248
1245
w,
@@ -1280,8 +1277,11 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
1280
1277
if let Some ( ( heading, fields) ) = heading_and_fields {
1281
1278
let variant_id =
1282
1279
cx. derive_id ( format ! ( "{}.{}.fields" , ItemType :: Variant , variant. name. unwrap( ) ) ) ;
1283
- write ! ( w, "<div class=\" sub-variant\" id=\" {id}\" >" , id = variant_id) ;
1284
- write ! ( w, "<h4>{heading}</h4>" , heading = heading) ;
1280
+ write ! (
1281
+ w,
1282
+ "<div class=\" sub-variant\" id=\" {variant_id}\" >\
1283
+ <h4>{heading}</h4>",
1284
+ ) ;
1285
1285
document_non_exhaustive ( w, variant) ;
1286
1286
for field in fields {
1287
1287
match * field. kind {
@@ -1299,7 +1299,6 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
1299
1299
<a href=\" #{id}\" class=\" anchor field\" >§</a>\
1300
1300
<code>{f}: {t}</code>\
1301
1301
</span>",
1302
- id = id,
1303
1302
f = field. name. unwrap( ) ,
1304
1303
t = ty. print( cx)
1305
1304
) ;
@@ -1450,11 +1449,9 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
1450
1449
w,
1451
1450
"<span id=\" {id}\" class=\" {item_type} small-section-header\" >\
1452
1451
<a href=\" #{id}\" class=\" anchor field\" >§</a>\
1453
- <code>{name }: {ty}</code>\
1452
+ <code>{field_name }: {ty}</code>\
1454
1453
</span>",
1455
1454
item_type = ItemType :: StructField ,
1456
- id = id,
1457
- name = field_name,
1458
1455
ty = ty. print( cx)
1459
1456
) ;
1460
1457
document ( w, cx, field, Some ( it) , HeadingOffset :: H3 ) ;
@@ -1840,8 +1837,8 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
1840
1837
if layout. abi . is_unsized ( ) {
1841
1838
write ! ( w, "(unsized)" ) ;
1842
1839
} else {
1843
- let bytes = layout. size . bytes ( ) - tag_size;
1844
- write ! ( w, "{size} byte{pl}" , size = bytes , pl = if bytes == 1 { "" } else { "s" } , ) ;
1840
+ let size = layout. size . bytes ( ) - tag_size;
1841
+ write ! ( w, "{size} byte{pl}" , pl = if size == 1 { "" } else { "s" } , ) ;
1845
1842
}
1846
1843
}
1847
1844
@@ -1896,7 +1893,7 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
1896
1893
1897
1894
for ( index, layout) in variants. iter_enumerated ( ) {
1898
1895
let name = adt. variant ( index) . name ;
1899
- write ! ( w, "<li><code>{name}</code>: " , name = name ) ;
1896
+ write ! ( w, "<li><code>{name}</code>: " ) ;
1900
1897
write_size_of_layout ( w, layout, tag_size) ;
1901
1898
writeln ! ( w, "</li>" ) ;
1902
1899
}
0 commit comments