Add colors for rustdoc primitives, type, and macros links

This commit is contained in:
mdinger
2015-10-23 21:59:48 -04:00
parent b1e3baa5b4
commit 11c7bdd160
2 changed files with 5 additions and 2 deletions

View File

@@ -378,7 +378,7 @@ fn primitive_link(f: &mut fmt::Formatter,
Some(&LOCAL_CRATE) => {
let len = CURRENT_LOCATION_KEY.with(|s| s.borrow().len());
let len = if len == 0 {0} else {len - 1};
try!(write!(f, "<a href='{}primitive.{}.html'>",
try!(write!(f, "<a class='primitive' href='{}primitive.{}.html'>",
repeat("../").take(len).collect::<String>(),
prim.to_url_str()));
needs_termination = true;
@@ -398,7 +398,7 @@ fn primitive_link(f: &mut fmt::Formatter,
};
match loc {
Some(root) => {
try!(write!(f, "<a href='{}{}/primitive.{}.html'>",
try!(write!(f, "<a class='primitive' href='{}{}/primitive.{}.html'>",
root,
path.0.first().unwrap(),
prim.to_url_str()));