about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-01-24 15:26:20 +0000
committerbors <bors@rust-lang.org>2017-01-24 15:26:20 +0000
commitfe597dc9a9f325de9b2b11d69e190e1c22c4e7dc (patch)
tree5c37ecb0f165d1f586dc69fc5c56adfe3f2d31bb
parentd2d8ae6575281e92a58899fb8f8c51fc8f84de04 (diff)
parentcbfc8fe3eb3f54b3ad89b87db75092acbed9926b (diff)
Auto merge of #39222 - GuillaumeGomez:rustdoc_where, r=frewsxcv,steveklabnik,alexcrichton,nrc
Force backline on all where in docs

Pictures are better than words in this case:

Before:

<img width="1440" alt="screen shot 2017-01-21 at 15 34 27" src="https://cloud.githubusercontent.com/assets/3050060/22175139/6e7c75d8-dfef-11e6-9904-023d63e609d2.png">

After:

<img width="1440" alt="screen shot 2017-01-21 at 15 34 32" src="https://cloud.githubusercontent.com/assets/3050060/22175140/75cc3846-dfef-11e6-9799-fffb213653e4.png">

r? @steveklabnik

cc @rust-lang/docs
-rw-r--r--src/librustdoc/html/format.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index d25c4184f3c..60dae19d876 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -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 {
@@ -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>()