1
Fork 0

Remove extra space before a where clause in the documentation

This commit is contained in:
Loïc BRANSTETT 2022-04-08 17:33:40 +02:00
parent ac8b11810f
commit f7ce145d83
4 changed files with 19 additions and 1 deletions

View file

@ -371,7 +371,8 @@ crate fn print_where_clause<'a, 'tcx: 'a>(
clause = clause.replace("<br>", &format!("<br>{}", padding));
clause.insert_str(0, &"&nbsp;".repeat(indent.saturating_sub(1)));
if !end_newline {
clause.insert_str(0, "<br>");
// we insert the <br> after a single space but before multiple spaces at the start
clause.insert_str(if indent == 0 { 1 } else { 0 }, "<br>");
}
}
write!(f, "{}", clause)