Skip to content

Commit

Permalink
Add trait methods as well
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 17, 2017
1 parent 85dcf2e commit d86621f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2400,8 +2400,9 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
let item_type = m.type_();
let id = derive_id(format!("{}.{}", item_type, name));
let ns_id = derive_id(format!("{}.{}", name, item_type.name_space()));
write!(w, "<h3 id='{id}' class='method'>\
write!(w, "{extra}<h3 id='{id}' class='method'>\
<span id='{ns_id}' class='invisible'><code>",
extra = render_spotlight_traits(m)?,
id = id,
ns_id = ns_id)?;
render_assoc_item(w, m, AssocItemLink::Anchor(Some(&id)), ItemType::Impl)?;
Expand Down
9 changes: 8 additions & 1 deletion src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,11 @@ h4 > code, h3 > code, .invisible > code {
font-size: 0.8em;
}

.content .methods > div { margin-left: 40px; }
.content .methods > div:not(.important-traits) { margin-left: 40px; }

.content .impl-items .docblock, .content .impl-items .stability {
margin-left: 40px;
margin-bottom: .6em;
}
.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
margin-left: 20px;
Expand Down Expand Up @@ -1045,4 +1046,10 @@ h3.important {
position: absolute;
left: -24px;
margin-top: 16px;
}

.content > .methods > div.important-traits {
position: absolute;
left: -42px;
margin-top: 2px;
}

0 comments on commit d86621f

Please sign in to comment.