@@ -1439,7 +1439,7 @@ impl clean::FnDecl {
1439
1439
write!(f, "\n{}", Indent(n + 4))?;
1440
1440
}
1441
1441
1442
- let last_input_index = self.inputs.values.len() - 1 ;
1442
+ let last_input_index = self.inputs.values.len().checked_sub(1) ;
1443
1443
for (i, input) in self.inputs.values.iter().enumerate() {
1444
1444
if let Some(selfty) = input.to_self() {
1445
1445
match selfty {
@@ -1473,11 +1473,12 @@ impl clean::FnDecl {
1473
1473
write!(f, "{}: ", input.name)?;
1474
1474
input.type_.print(cx).fmt(f)?;
1475
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))?,
1476
+ match (line_wrapping_indent, last_input_index) {
1477
+ (_, None) => (),
1478
+ (None, Some(last_i)) if i != last_i => write!(f, ", ")?,
1479
+ (None, Some(_)) => (),
1480
+ (Some(n), Some(last_i)) if i != last_i => write!(f, ",\n{}", Indent(n + 4))?,
1481
+ (Some(_), Some(_)) => write!(f, ",\n")?,
1481
1482
}
1482
1483
}
1483
1484
0 commit comments