Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit b17cf7a

Browse files
Remove unwanted trailing whitespaces for long declarations
1 parent 66c83ff commit b17cf7a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/librustdoc/html/format.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,10 +1283,6 @@ impl clean::FnDecl {
12831283
let mut args = Buffer::html();
12841284
let mut args_plain = Buffer::new();
12851285
for (i, input) in self.inputs.values.iter().enumerate() {
1286-
if i == 0 {
1287-
args.push_str("<br>");
1288-
}
1289-
12901286
if let Some(selfty) = input.to_self() {
12911287
match selfty {
12921288
clean::SelfValue => {
@@ -1312,8 +1308,7 @@ impl clean::FnDecl {
13121308
}
13131309
} else {
13141310
if i > 0 {
1315-
args.push_str(" <br>");
1316-
args_plain.push_str(" ");
1311+
args.push_str("<br>");
13171312
}
13181313
if input.is_const {
13191314
args.push_str("const ");
@@ -1360,13 +1355,14 @@ impl clean::FnDecl {
13601355
let full_pad = format!("<br>{}", "&nbsp;".repeat(indent + 4));
13611356
let close_pad = format!("<br>{}", "&nbsp;".repeat(indent));
13621357
format!(
1363-
"({args}{close}){arrow}",
1358+
"({pad}{args}{close}){arrow}",
1359+
pad = if self.inputs.values.is_empty() { "" } else { &full_pad },
13641360
args = args.replace("<br>", &full_pad),
13651361
close = close_pad,
13661362
arrow = arrow
13671363
)
13681364
} else {
1369-
format!("({args}){arrow}", args = args.replace("<br>", ""), arrow = arrow)
1365+
format!("({args}){arrow}", args = args.replace("<br>", " "), arrow = arrow)
13701366
};
13711367

13721368
if f.alternate() {

0 commit comments

Comments
 (0)