1
Fork 0

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")?;
}
}