@@ -514,7 +514,7 @@ fn item_function(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, f: &cle
514
514
+ name. as_str ( ) . len ( )
515
515
+ generics_len;
516
516
517
- wrap_into_docblock ( w, |w| {
517
+ wrap_into_item_decl ( w, |w| {
518
518
wrap_item ( w, "fn" , |w| {
519
519
render_attributes_in_pre ( w, it, "" ) ;
520
520
w. reserve ( header_len) ;
@@ -553,7 +553,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
553
553
cx. tcx ( ) . trait_def ( t. def_id ) . must_implement_one_of . clone ( ) ;
554
554
555
555
// Output the trait definition
556
- wrap_into_docblock ( w, |w| {
556
+ wrap_into_item_decl ( w, |w| {
557
557
wrap_item ( w, "trait" , |w| {
558
558
render_attributes_in_pre ( w, it, "" ) ;
559
559
write ! (
@@ -1033,7 +1033,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
1033
1033
}
1034
1034
1035
1035
fn item_trait_alias ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , t : & clean:: TraitAlias ) {
1036
- wrap_into_docblock ( w, |w| {
1036
+ wrap_into_item_decl ( w, |w| {
1037
1037
wrap_item ( w, "trait-alias" , |w| {
1038
1038
render_attributes_in_pre ( w, it, "" ) ;
1039
1039
write ! (
@@ -1057,7 +1057,7 @@ fn item_trait_alias(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &
1057
1057
}
1058
1058
1059
1059
fn item_opaque_ty ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , t : & clean:: OpaqueTy ) {
1060
- wrap_into_docblock ( w, |w| {
1060
+ wrap_into_item_decl ( w, |w| {
1061
1061
wrap_item ( w, "opaque" , |w| {
1062
1062
render_attributes_in_pre ( w, it, "" ) ;
1063
1063
write ! (
@@ -1096,7 +1096,7 @@ fn item_typedef(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clea
1096
1096
} ) ;
1097
1097
}
1098
1098
1099
- wrap_into_docblock ( w, |w| write_content ( w, cx, it, t) ) ;
1099
+ wrap_into_item_decl ( w, |w| write_content ( w, cx, it, t) ) ;
1100
1100
1101
1101
document ( w, cx, it, None , HeadingOffset :: H2 ) ;
1102
1102
@@ -1110,7 +1110,7 @@ fn item_typedef(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clea
1110
1110
}
1111
1111
1112
1112
fn item_union ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Union ) {
1113
- wrap_into_docblock ( w, |w| {
1113
+ wrap_into_item_decl ( w, |w| {
1114
1114
wrap_item ( w, "union" , |w| {
1115
1115
render_attributes_in_pre ( w, it, "" ) ;
1116
1116
render_union ( w, it, Some ( & s. generics ) , & s. fields , "" , cx) ;
@@ -1174,7 +1174,7 @@ fn print_tuple_struct_fields(w: &mut Buffer, cx: &Context<'_>, s: &[clean::Item]
1174
1174
1175
1175
fn item_enum ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , e : & clean:: Enum ) {
1176
1176
let count_variants = e. variants ( ) . count ( ) ;
1177
- wrap_into_docblock ( w, |w| {
1177
+ wrap_into_item_decl ( w, |w| {
1178
1178
wrap_item ( w, "enum" , |w| {
1179
1179
render_attributes_in_pre ( w, it, "" ) ;
1180
1180
write ! (
@@ -1333,14 +1333,14 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
1333
1333
}
1334
1334
1335
1335
fn item_macro ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , t : & clean:: Macro ) {
1336
- wrap_into_docblock ( w, |w| {
1336
+ wrap_into_item_decl ( w, |w| {
1337
1337
highlight:: render_macro_with_highlighting ( & t. source , w) ;
1338
1338
} ) ;
1339
1339
document ( w, cx, it, None , HeadingOffset :: H2 )
1340
1340
}
1341
1341
1342
1342
fn item_proc_macro ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , m : & clean:: ProcMacro ) {
1343
- wrap_into_docblock ( w, |w| {
1343
+ wrap_into_item_decl ( w, |w| {
1344
1344
let name = it. name . expect ( "proc-macros always have names" ) ;
1345
1345
match m. kind {
1346
1346
MacroKind :: Bang => {
@@ -1387,7 +1387,7 @@ fn item_primitive(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item) {
1387
1387
}
1388
1388
1389
1389
fn item_constant ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , c : & clean:: Constant ) {
1390
- wrap_into_docblock ( w, |w| {
1390
+ wrap_into_item_decl ( w, |w| {
1391
1391
wrap_item ( w, "const" , |w| {
1392
1392
render_attributes_in_code ( w, it) ;
1393
1393
@@ -1436,7 +1436,7 @@ fn item_constant(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, c: &cle
1436
1436
}
1437
1437
1438
1438
fn item_struct ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Struct ) {
1439
- wrap_into_docblock ( w, |w| {
1439
+ wrap_into_item_decl ( w, |w| {
1440
1440
wrap_item ( w, "struct" , |w| {
1441
1441
render_attributes_in_code ( w, it) ;
1442
1442
render_struct ( w, it, Some ( & s. generics ) , s. struct_type , & s. fields , "" , true , cx) ;
@@ -1489,7 +1489,7 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
1489
1489
}
1490
1490
1491
1491
fn item_static ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Static ) {
1492
- wrap_into_docblock ( w, |w| {
1492
+ wrap_into_item_decl ( w, |w| {
1493
1493
wrap_item ( w, "static" , |w| {
1494
1494
render_attributes_in_code ( w, it) ;
1495
1495
write ! (
@@ -1506,7 +1506,7 @@ fn item_static(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
1506
1506
}
1507
1507
1508
1508
fn item_foreign_type ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item ) {
1509
- wrap_into_docblock ( w, |w| {
1509
+ wrap_into_item_decl ( w, |w| {
1510
1510
wrap_item ( w, "foreigntype" , |w| {
1511
1511
w. write_str ( "extern {\n " ) ;
1512
1512
render_attributes_in_code ( w, it) ;
@@ -1595,11 +1595,11 @@ fn bounds(t_bounds: &[clean::GenericBound], trait_alias: bool, cx: &Context<'_>)
1595
1595
bounds
1596
1596
}
1597
1597
1598
- fn wrap_into_docblock < F > ( w : & mut Buffer , f : F )
1598
+ fn wrap_into_item_decl < F > ( w : & mut Buffer , f : F )
1599
1599
where
1600
1600
F : FnOnce ( & mut Buffer ) ,
1601
1601
{
1602
- w. write_str ( "<div class=\" docblock item-decl\" >" ) ;
1602
+ w. write_str ( "<div class=\" item-decl\" >" ) ;
1603
1603
f ( w) ;
1604
1604
w. write_str ( "</div>" )
1605
1605
}
0 commit comments