Skip to content

Force backline on all where in docs #39222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/librustdoc/html/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl<'a> fmt::Display for WhereClause<'a> {
if f.alternate() {
clause.push_str(" where ");
} else {
clause.push_str(" <span class='where'>where ");
clause.push_str(" <span class='where fmt-newline'>where ");
}
for (i, pred) in gens.where_predicates.iter().enumerate() {
if i > 0 {
Expand Down Expand Up @@ -208,10 +208,9 @@ impl<'a> fmt::Display for WhereClause<'a> {
clause.push_str("</span>");
let plain = format!("{:#}", self);
if plain.len() + pad > 80 {
//break it onto its own line regardless, but make sure method impls and trait
//blocks keep their fixed padding (2 and 9, respectively)
// 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 > 10 {
clause = clause.replace("class='where'", "class='where fmt-newline'");
repeat("&nbsp;").take(8).collect::<String>()
} else {
repeat("&nbsp;").take(pad + 6).collect::<String>()
Expand Down