Skip to content

Commit 1e9c7c5

Browse files
committed
rollup merge of #20269: dirk/indent-where
* Add <span class=‘where’> around clause * CSS rule to format the span (for issue #20176)
2 parents 1d373ae + 57a3ef3 commit 1e9c7c5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/librustdoc/html/format.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'a> fmt::Show for WhereClause<'a> {
120120
if gens.where_predicates.len() == 0 {
121121
return Ok(());
122122
}
123-
try!(f.write(" where ".as_bytes()));
123+
try!(f.write(" <span class='where'>where ".as_bytes()));
124124
for (i, pred) in gens.where_predicates.iter().enumerate() {
125125
if i > 0 {
126126
try!(f.write(", ".as_bytes()));
@@ -146,6 +146,7 @@ impl<'a> fmt::Show for WhereClause<'a> {
146146
}
147147
}
148148
}
149+
try!(f.write("</span>".as_bytes()));
149150
Ok(())
150151
}
151152
}

src/librustdoc/html/static/main.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ nav.sub {
306306
font-size: 1em;
307307
position: relative;
308308
}
309+
/* Shift "where ..." part of method definition down a line */
310+
.content .method .where { display: block; }
311+
/* Bit of whitespace to indent it */
312+
.content .method .where::before { content: ' '; }
313+
309314
.content .methods .docblock { margin-left: 40px; }
310315

311316
.content .impl-items .docblock { margin-left: 40px; }

0 commit comments

Comments
 (0)