clause.push_str("</span>");
let plain = format!("{:#}", self);
if plain.len() + pad.len() > 80 {
- let padding = repeat(" ").take(pad.len() + 6).collect::<String>();
+ let padding = if pad.len() + 25 > 80 {
+ clause = clause.replace("class='where'", "class='where fmt-newline'");
+ repeat(" ").take(8).collect::<String>()
+ } else {
+ repeat(" ").take(pad.len() + 6).collect::<String>()
+ };
clause = clause.replace("<br>", &format!("<br>{}", padding));
} else {
clause = clause.replace("<br>", " ");
position: relative;
}
/* Shift "where ..." part of method or fn definition down a line */
-.content .method .where, .content .fn .where { display: block; }
+.content .method .where,
+.content .fn .where,
+.content .where.fmt-newline {
+ display: block;
+}
/* Bit of whitespace to indent it */
-.content .method .where::before, .content .fn .where::before { content: ' '; }
+.content .method .where::before,
+.content .fn .where::before,
+.content .where.fmt-newline::before {
+ content: ' ';
+}
.content .methods > div { margin-left: 40px; }