Skip to content

Commit

Permalink
rustdoc: if a where clause gets any lines, it gets its own line
Browse files Browse the repository at this point in the history
  • Loading branch information
QuietMisdreavus committed Oct 16, 2016
1 parent 07b27bb commit 43abad4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustdoc/html/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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("&nbsp;").take(8).collect::<String>()
} else {
Expand Down

0 comments on commit 43abad4

Please sign in to comment.