Remove unwanted trailing whitespaces for long declarations
This commit is contained in:
parent
66c83ffca1
commit
b17cf7a493
@ -1283,10 +1283,6 @@ impl clean::FnDecl {
|
|||||||
let mut args = Buffer::html();
|
let mut args = Buffer::html();
|
||||||
let mut args_plain = Buffer::new();
|
let mut args_plain = Buffer::new();
|
||||||
for (i, input) in self.inputs.values.iter().enumerate() {
|
for (i, input) in self.inputs.values.iter().enumerate() {
|
||||||
if i == 0 {
|
|
||||||
args.push_str("<br>");
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(selfty) = input.to_self() {
|
if let Some(selfty) = input.to_self() {
|
||||||
match selfty {
|
match selfty {
|
||||||
clean::SelfValue => {
|
clean::SelfValue => {
|
||||||
@ -1312,8 +1308,7 @@ impl clean::FnDecl {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
args.push_str(" <br>");
|
args.push_str("<br>");
|
||||||
args_plain.push_str(" ");
|
|
||||||
}
|
}
|
||||||
if input.is_const {
|
if input.is_const {
|
||||||
args.push_str("const ");
|
args.push_str("const ");
|
||||||
@ -1360,13 +1355,14 @@ impl clean::FnDecl {
|
|||||||
let full_pad = format!("<br>{}", " ".repeat(indent + 4));
|
let full_pad = format!("<br>{}", " ".repeat(indent + 4));
|
||||||
let close_pad = format!("<br>{}", " ".repeat(indent));
|
let close_pad = format!("<br>{}", " ".repeat(indent));
|
||||||
format!(
|
format!(
|
||||||
"({args}{close}){arrow}",
|
"({pad}{args}{close}){arrow}",
|
||||||
|
pad = if self.inputs.values.is_empty() { "" } else { &full_pad },
|
||||||
args = args.replace("<br>", &full_pad),
|
args = args.replace("<br>", &full_pad),
|
||||||
close = close_pad,
|
close = close_pad,
|
||||||
arrow = arrow
|
arrow = arrow
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
format!("({args}){arrow}", args = args.replace("<br>", ""), arrow = arrow)
|
format!("({args}){arrow}", args = args.replace("<br>", " "), arrow = arrow)
|
||||||
};
|
};
|
||||||
|
|
||||||
if f.alternate() {
|
if f.alternate() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user