]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: properly calculate line length for impl where clauses
authorQuietMisdreavus <bryan@icesoldier.me>
Tue, 20 Dec 2016 17:33:34 +0000 (11:33 -0600)
committerQuietMisdreavus <bryan@icesoldier.me>
Tue, 20 Dec 2016 17:33:34 +0000 (11:33 -0600)
src/librustdoc/html/format.rs

index 6dc6e80dae0b81fb926e5238e145fedcb07704ce..796a3a93068c8a5d8886a39b83057594ffdce949 100644 (file)
@@ -207,7 +207,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         if !f.alternate() {
             clause.push_str("</span>");
             let plain = format!("{:#}", self);
-            if plain.len() > 80 {
+            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)
                 let padding = if pad > 10 {