@@ -1431,20 +1431,16 @@ impl clean::FnDecl {
1431
1431
cx : & Context < ' _ > ,
1432
1432
) -> fmt:: Result {
1433
1433
let amp = if f. alternate ( ) { "&" } else { "&" } ;
1434
-
1434
+
1435
1435
write ! ( f, "(" ) ?;
1436
1436
if let Some ( n) = line_wrapping_indent
1437
1437
&& !self . inputs . values . is_empty ( )
1438
1438
{
1439
1439
write ! ( f, "\n {}" , Indent ( n + 4 ) ) ?;
1440
1440
}
1441
+
1442
+ let last_input_index = self . inputs . values . len ( ) - 1 ;
1441
1443
for ( i, input) in self . inputs . values . iter ( ) . enumerate ( ) {
1442
- if i > 0 {
1443
- match line_wrapping_indent {
1444
- None => write ! ( f, ", " ) ?,
1445
- Some ( n) => write ! ( f, ",\n {}" , Indent ( n + 4 ) ) ?,
1446
- } ;
1447
- }
1448
1444
if let Some ( selfty) = input. to_self ( ) {
1449
1445
match selfty {
1450
1446
clean:: SelfValue => {
@@ -1477,18 +1473,24 @@ impl clean::FnDecl {
1477
1473
write ! ( f, "{}: " , input. name) ?;
1478
1474
input. type_ . print ( cx) . fmt ( f) ?;
1479
1475
}
1476
+ match line_wrapping_indent {
1477
+ None if i == last_input_index => ( ) ,
1478
+ None => write ! ( f, ", " ) ?,
1479
+ Some ( _n) if i == last_input_index => write ! ( f, ",\n " ) ?,
1480
+ Some ( n) => write ! ( f, ",\n {}" , Indent ( n + 4 ) ) ?,
1481
+ }
1480
1482
}
1481
1483
1482
1484
if self . c_variadic {
1483
1485
match line_wrapping_indent {
1484
- None => write ! ( f, ", ..." ) ?,
1485
- Some ( n) => write ! ( f, "\n {}..." , Indent ( n + 4 ) ) ?,
1486
+ None => write ! ( f, "..." ) ?,
1487
+ Some ( n) => write ! ( f, "{}...\n " , Indent ( n + 4 ) ) ?,
1486
1488
} ;
1487
1489
}
1488
1490
1489
1491
match line_wrapping_indent {
1490
1492
None => write ! ( f, ")" ) ?,
1491
- Some ( n) => write ! ( f, "\n {})" , Indent ( n) ) ?,
1493
+ Some ( n) => write ! ( f, "{})" , Indent ( n) ) ?,
1492
1494
} ;
1493
1495
1494
1496
self . print_output ( cx) . fmt ( f)
0 commit comments