Skip to content

Commit 33c4250

Browse files
author
Ulrik Sverdrup
committed
rustdoc: Add Associated Constants section
Section only visible if there are assoc. consts. present.
1 parent ff4e061 commit 33c4250

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/librustdoc/html/render.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,17 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
18621862
try!(write!(w, "</div>"));
18631863
}
18641864

1865+
if !consts.is_empty() {
1866+
try!(write!(w, "
1867+
<h2 id='associated-const'>Associated Constants</h2>
1868+
<div class='methods'>
1869+
"));
1870+
for t in &consts {
1871+
try!(trait_item(w, *t));
1872+
}
1873+
try!(write!(w, "</div>"));
1874+
}
1875+
18651876
// Output the documentation for each function individually
18661877
if !required.is_empty() {
18671878
try!(write!(w, "

0 commit comments

Comments
 (0)