add [src] links to associated functions inside an impl block

This commit is contained in:
QuietMisdreavus 2017-07-27 13:26:24 -05:00
parent 5669c9988f
commit c9bdd518eb
2 changed files with 13 additions and 1 deletions

View File

@ -2939,7 +2939,15 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
write!(w, "<code>")?;
render_assoc_item(w, item, link.anchor(&id), ItemType::Impl)?;
write!(w, "</code>")?;
render_stability_since_raw(w, item.stable_since(), outer_version)?;
if let Some(l) = (Item { cx, item }).src_href() {
write!(w, "</span><span class='out-of-band'>")?;
write!(w, "<div class='ghost'></div>")?;
render_stability_since_raw(w, item.stable_since(), outer_version)?;
write!(w, "<a class='srclink' href='{}' title='{}'>[src]</a>",
l, "goto source code")?;
} else {
render_stability_since_raw(w, item.stable_since(), outer_version)?;
}
write!(w, "</span></h4>\n")?;
}
}

View File

@ -297,6 +297,10 @@ h3.impl > .out-of-band {
font-size: 21px;
}
h4.method > .out-of-band {
font-size: 19px;
}
h4 > code, h3 > code, .invisible > code {
position: inherit;
}