Skip to content

Commit 43abad4

Browse files
author
QuietMisdreavus
committed
rustdoc: if a where clause gets any lines, it gets its own line
1 parent 07b27bb commit 43abad4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustdoc/html/format.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ impl<'a> fmt::Display for WhereClause<'a> {
208208
clause.push_str("</span>");
209209
let plain = format!("{:#}", self);
210210
if plain.len() + pad.len() > 80 {
211-
let padding = if pad.len() + 25 > 80 {
211+
//break it onto its own line regardless, but make sure method impls and trait
212+
//blocks keep their fixed padding (2 and 9, respectively)
213+
let padding = if pad.len() > 10 {
212214
clause = clause.replace("class='where'", "class='where fmt-newline'");
213215
repeat("&nbsp;").take(8).collect::<String>()
214216
} else {

0 commit comments

Comments
 (0)