Skip to content

Commit 9cfd4ef

Browse files
author
QuietMisdreavus
committed
rustdoc: print arguments to bare functions on their own line
1 parent 4c04e36 commit 9cfd4ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustdoc/html/format.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,15 @@ pub fn fmt_impl_for_trait_page(i: &clean::Impl, f: &mut fmt::Formatter) -> fmt::
618618
impl fmt::Display for clean::Arguments {
619619
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
620620
for (i, input) in self.values.iter().enumerate() {
621-
if i > 0 { write!(f, ", ")?; }
621+
write!(f, "\n ")?;
622622
if !input.name.is_empty() {
623623
write!(f, "{}: ", input.name)?;
624624
}
625625
write!(f, "{}", input.type_)?;
626+
if i + 1 < self.values.len() { write!(f, ",")?; }
627+
}
628+
if !self.values.is_empty() {
629+
write!(f, "\n")?;
626630
}
627631
Ok(())
628632
}

0 commit comments

Comments
 (0)