File tree 1 file changed +21
-25
lines changed
src/librustdoc/html/render
1 file changed +21
-25
lines changed Original file line number Diff line number Diff line change @@ -2365,31 +2365,27 @@ fn render_struct_fields(
2365
2365
{
2366
2366
write_str ( w, format_args ! ( "<span class=\" comment\" >/* private fields */</span>" ) ) ;
2367
2367
} else {
2368
- write_str (
2369
- w,
2370
- format_args ! (
2371
- "{}" ,
2372
- fmt:: from_fn( |f| fields
2373
- . iter( )
2374
- . map( |field| {
2375
- fmt:: from_fn( |f| match field. kind {
2376
- clean:: StrippedItem ( box clean:: StructFieldItem ( ..) ) => {
2377
- write!( f, "_" )
2378
- }
2379
- clean:: StructFieldItem ( ref ty) => {
2380
- write!(
2381
- f,
2382
- "{}{}" ,
2383
- visibility_print_with_space( field, cx) ,
2384
- ty. print( cx)
2385
- )
2386
- }
2387
- _ => unreachable!( ) ,
2388
- } )
2389
- } )
2390
- . joined( ", " , f) )
2391
- ) ,
2392
- ) ;
2368
+ for ( i, field) in fields. iter ( ) . enumerate ( ) {
2369
+ if i > 0 {
2370
+ w. push_str ( ", " ) ;
2371
+ }
2372
+ match field. kind {
2373
+ clean:: StrippedItem ( box clean:: StructFieldItem ( ..) ) => {
2374
+ write_str ( w, format_args ! ( "_" ) ) ;
2375
+ }
2376
+ clean:: StructFieldItem ( ref ty) => {
2377
+ write_str (
2378
+ w,
2379
+ format_args ! (
2380
+ "{}{}" ,
2381
+ visibility_print_with_space( field, cx) ,
2382
+ ty. print( cx)
2383
+ ) ,
2384
+ ) ;
2385
+ }
2386
+ _ => unreachable ! ( ) ,
2387
+ }
2388
+ }
2393
2389
}
2394
2390
w. push_str ( ")" ) ;
2395
2391
if let Some ( g) = g {
You can’t perform that action at this time.
0 commit comments