Skip to content

Commit d86621f

Browse files
Add trait methods as well
1 parent 85dcf2e commit d86621f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/librustdoc/html/render.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2400,8 +2400,9 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
24002400
let item_type = m.type_();
24012401
let id = derive_id(format!("{}.{}", item_type, name));
24022402
let ns_id = derive_id(format!("{}.{}", name, item_type.name_space()));
2403-
write!(w, "<h3 id='{id}' class='method'>\
2403+
write!(w, "{extra}<h3 id='{id}' class='method'>\
24042404
<span id='{ns_id}' class='invisible'><code>",
2405+
extra = render_spotlight_traits(m)?,
24052406
id = id,
24062407
ns_id = ns_id)?;
24072408
render_assoc_item(w, m, AssocItemLink::Anchor(Some(&id)), ItemType::Impl)?;

src/librustdoc/html/static/rustdoc.css

+8-1
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,11 @@ h4 > code, h3 > code, .invisible > code {
438438
font-size: 0.8em;
439439
}
440440

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

443443
.content .impl-items .docblock, .content .impl-items .stability {
444444
margin-left: 40px;
445+
margin-bottom: .6em;
445446
}
446447
.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
447448
margin-left: 20px;
@@ -1045,4 +1046,10 @@ h3.important {
10451046
position: absolute;
10461047
left: -24px;
10471048
margin-top: 16px;
1049+
}
1050+
1051+
.content > .methods > div.important-traits {
1052+
position: absolute;
1053+
left: -42px;
1054+
margin-top: 2px;
10481055
}

0 commit comments

Comments
 (0)