Skip to content

Commit

Permalink
Indent where clause in rustdoc
Browse files Browse the repository at this point in the history
* Add <span class=‘where’> around clause
* CSS rule to format the span
(for #20176)
  • Loading branch information
dirk committed Dec 28, 2014
1 parent 070ab63 commit 4477c7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustdoc/html/format.rs
Expand Up @@ -123,7 +123,7 @@ impl<'a> fmt::Show for WhereClause<'a> {
if gens.where_predicates.len() == 0 {
return Ok(());
}
try!(f.write(" where ".as_bytes()));
try!(f.write(" <span class='where'>where ".as_bytes()));
for (i, pred) in gens.where_predicates.iter().enumerate() {
if i > 0 {
try!(f.write(", ".as_bytes()));
Expand All @@ -149,6 +149,7 @@ impl<'a> fmt::Show for WhereClause<'a> {
}
}
}
try!(f.write("</span>".as_bytes()));
Ok(())
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/librustdoc/html/static/main.css
Expand Up @@ -306,6 +306,9 @@ nav.sub {
font-size: 1em;
position: relative;
}
/* Shift "where ..." part of method definition down a line and indent it */
.content .method .where { display: block; padding-left: 3.75em; }

.content .methods .docblock { margin-left: 40px; }

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

0 comments on commit 4477c7c

Please sign in to comment.