diff options
| author | QuietMisdreavus <bryan@icesoldier.me> | 2016-10-15 21:52:18 -0500 |
|---|---|---|
| committer | QuietMisdreavus <bryan@icesoldier.me> | 2016-10-15 21:52:18 -0500 |
| commit | 43abad45837a15c62828b700aff7efd8eee76cfd (patch) | |
| tree | 663e6008bbb1943980738f6a9f499423a9b5565d | |
| parent | 07b27bb34c4ce32152369d202cac7a4e0c9878af (diff) | |
rustdoc: if a where clause gets any lines, it gets its own line
| -rw-r--r-- | src/librustdoc/html/format.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 5fb99a2031f..c4a4817195b 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -208,7 +208,9 @@ impl<'a> fmt::Display for WhereClause<'a> { clause.push_str("</span>"); let plain = format!("{:#}", self); if plain.len() + pad.len() > 80 { - let padding = if pad.len() + 25 > 80 { + //break it onto its own line regardless, but make sure method impls and trait + //blocks keep their fixed padding (2 and 9, respectively) + let padding = if pad.len() > 10 { clause = clause.replace("class='where'", "class='where fmt-newline'"); repeat(" ").take(8).collect::<String>() } else { |
