1
Fork 0

Linkify extern crates on rustdoc pages

This commit is contained in:
mitaa 2016-04-25 08:24:50 +02:00
parent 645dd013ac
commit 0b5b782e39
8 changed files with 79 additions and 13 deletions

View file

@ -1739,16 +1739,19 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
match myitem.inner {
clean::ExternCrateItem(ref name, ref src) => {
use html::format::HRef;
match *src {
Some(ref src) => {
write!(w, "<tr><td><code>{}extern crate {} as {};",
VisSpace(&myitem.visibility),
src,
HRef::new(myitem.def_id, src),
name)?
}
None => {
write!(w, "<tr><td><code>{}extern crate {};",
VisSpace(&myitem.visibility), name)?
VisSpace(&myitem.visibility),
HRef::new(myitem.def_id, name))?
}
}
write!(w, "</code></td></tr>")?;