Skip to content

Commit

Permalink
add [src] links to associated functions inside an impl block
Browse files Browse the repository at this point in the history
  • Loading branch information
QuietMisdreavus committed Jul 27, 2017
1 parent 5669c99 commit c9bdd51
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")?;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c9bdd51

Please sign in to comment.