rustdoc: move the space at the end of where clauses
...so that we don't indent the next line by one extra space
This commit is contained in:
@@ -237,15 +237,23 @@ impl<'a> fmt::Display for WhereClause<'a> {
|
|||||||
clause.push(',');
|
clause.push(',');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if end_newline {
|
||||||
|
//add a space so stripping <br> tags and breaking spaces still renders properly
|
||||||
|
if f.alternate() {
|
||||||
|
clause.push(' ');
|
||||||
|
} else {
|
||||||
|
clause.push_str(" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if !f.alternate() {
|
if !f.alternate() {
|
||||||
clause.push_str("</span>");
|
clause.push_str("</span>");
|
||||||
let padding = repeat(" ").take(indent + 4).collect::<String>();
|
let padding = repeat(" ").take(indent + 4).collect::<String>();
|
||||||
clause = clause.replace("<br>", &format!("<br>{}", padding));
|
clause = clause.replace("<br>", &format!("<br>{}", padding));
|
||||||
clause.insert_str(0, &repeat(" ").take(indent.saturating_sub(1))
|
clause.insert_str(0, &repeat(" ").take(indent.saturating_sub(1))
|
||||||
.collect::<String>());
|
.collect::<String>());
|
||||||
if end_newline {
|
if !end_newline {
|
||||||
clause.push(' ');
|
|
||||||
} else {
|
|
||||||
clause.insert_str(0, "<br>");
|
clause.insert_str(0, "<br>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user