@@ -531,7 +531,7 @@ fn item_function(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, f: &cle
531531 f. decl . output . as_return ( ) . and_then ( |output| notable_traits_button ( output, cx) ) ;
532532
533533 wrap_into_item_decl ( w, |w| {
534- wrap_item ( w, "fn" , |w| {
534+ wrap_item ( w, |w| {
535535 render_attributes_in_pre ( w, it, "" ) ;
536536 w. reserve ( header_len) ;
537537 write ! (
@@ -570,7 +570,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
570570
571571 // Output the trait definition
572572 wrap_into_item_decl ( w, |w| {
573- wrap_item ( w, "trait" , |w| {
573+ wrap_item ( w, |w| {
574574 render_attributes_in_pre ( w, it, "" ) ;
575575 write ! (
576576 w,
@@ -1051,7 +1051,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
10511051
10521052fn item_trait_alias ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , t : & clean:: TraitAlias ) {
10531053 wrap_into_item_decl ( w, |w| {
1054- wrap_item ( w, "trait-alias" , |w| {
1054+ wrap_item ( w, |w| {
10551055 render_attributes_in_pre ( w, it, "" ) ;
10561056 write ! (
10571057 w,
@@ -1075,7 +1075,7 @@ fn item_trait_alias(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &
10751075
10761076fn item_opaque_ty ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , t : & clean:: OpaqueTy ) {
10771077 wrap_into_item_decl ( w, |w| {
1078- wrap_item ( w, "opaque" , |w| {
1078+ wrap_item ( w, |w| {
10791079 render_attributes_in_pre ( w, it, "" ) ;
10801080 write ! (
10811081 w,
@@ -1099,7 +1099,7 @@ fn item_opaque_ty(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &cl
10991099
11001100fn item_typedef ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , t : & clean:: Typedef ) {
11011101 fn write_content ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , t : & clean:: Typedef ) {
1102- wrap_item ( w, "typedef" , |w| {
1102+ wrap_item ( w, |w| {
11031103 render_attributes_in_pre ( w, it, "" ) ;
11041104 write ! ( w, "{}" , visibility_print_with_space( it. visibility( cx. tcx( ) ) , it. item_id, cx) ) ;
11051105 write ! (
@@ -1128,7 +1128,7 @@ fn item_typedef(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clea
11281128
11291129fn item_union ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Union ) {
11301130 wrap_into_item_decl ( w, |w| {
1131- wrap_item ( w, "union" , |w| {
1131+ wrap_item ( w, |w| {
11321132 render_attributes_in_pre ( w, it, "" ) ;
11331133 render_union ( w, it, Some ( & s. generics ) , & s. fields , "" , cx) ;
11341134 } ) ;
@@ -1193,7 +1193,7 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
11931193 let tcx = cx. tcx ( ) ;
11941194 let count_variants = e. variants ( ) . count ( ) ;
11951195 wrap_into_item_decl ( w, |w| {
1196- wrap_item ( w, "enum" , |w| {
1196+ wrap_item ( w, |w| {
11971197 render_attributes_in_pre ( w, it, "" ) ;
11981198 write ! (
11991199 w,
@@ -1357,17 +1357,17 @@ fn item_proc_macro(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, m: &c
13571357 let name = it. name . expect ( "proc-macros always have names" ) ;
13581358 match m. kind {
13591359 MacroKind :: Bang => {
1360- wrap_item ( w, "macro" , |w| {
1360+ wrap_item ( w, |w| {
13611361 write ! ( w, "{}!() {{ /* proc-macro */ }}" , name) ;
13621362 } ) ;
13631363 }
13641364 MacroKind :: Attr => {
1365- wrap_item ( w, "attr" , |w| {
1365+ wrap_item ( w, |w| {
13661366 write ! ( w, "#[{}]" , name) ;
13671367 } ) ;
13681368 }
13691369 MacroKind :: Derive => {
1370- wrap_item ( w, "derive" , |w| {
1370+ wrap_item ( w, |w| {
13711371 write ! ( w, "#[derive({})]" , name) ;
13721372 if !m. helpers . is_empty ( ) {
13731373 w. push_str ( "\n {\n " ) ;
@@ -1401,7 +1401,7 @@ fn item_primitive(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item) {
14011401
14021402fn item_constant ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , c : & clean:: Constant ) {
14031403 wrap_into_item_decl ( w, |w| {
1404- wrap_item ( w, "const" , |w| {
1404+ wrap_item ( w, |w| {
14051405 let tcx = cx. tcx ( ) ;
14061406 render_attributes_in_code ( w, it) ;
14071407
@@ -1451,7 +1451,7 @@ fn item_constant(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, c: &cle
14511451
14521452fn item_struct ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Struct ) {
14531453 wrap_into_item_decl ( w, |w| {
1454- wrap_item ( w, "struct" , |w| {
1454+ wrap_item ( w, |w| {
14551455 render_attributes_in_code ( w, it) ;
14561456 render_struct ( w, it, Some ( & s. generics ) , s. ctor_kind , & s. fields , "" , true , cx) ;
14571457 } ) ;
@@ -1504,7 +1504,7 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
15041504
15051505fn item_static ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , s : & clean:: Static ) {
15061506 wrap_into_item_decl ( w, |w| {
1507- wrap_item ( w, "static" , |w| {
1507+ wrap_item ( w, |w| {
15081508 render_attributes_in_code ( w, it) ;
15091509 write ! (
15101510 w,
@@ -1521,7 +1521,7 @@ fn item_static(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
15211521
15221522fn item_foreign_type ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item ) {
15231523 wrap_into_item_decl ( w, |w| {
1524- wrap_item ( w, "foreigntype" , |w| {
1524+ wrap_item ( w, |w| {
15251525 w. write_str ( "extern {\n " ) ;
15261526 render_attributes_in_code ( w, it) ;
15271527 write ! (
@@ -1618,11 +1618,11 @@ where
16181618 w. write_str ( "</div>" )
16191619}
16201620
1621- fn wrap_item < F > ( w : & mut Buffer , item_name : & str , f : F )
1621+ fn wrap_item < F > ( w : & mut Buffer , f : F )
16221622where
16231623 F : FnOnce ( & mut Buffer ) ,
16241624{
1625- w. write_fmt ( format_args ! ( "<pre class=\ " rust {} \ " ><code>" , item_name ) ) ;
1625+ w. write_str ( r# "<pre class="rust"><code>"# ) ;
16261626 f ( w) ;
16271627 w. write_str ( "</code></pre>" ) ;
16281628}
0 commit comments