From fce944d4e79b3a87ddf511206724edf33acfd704 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 9 Feb 2017 10:38:29 -0700 Subject: [PATCH 1/2] Add the item type to the tooltip See: https://users.rust-lang.org/t/seeking-opinions-from-colorblind-rustaceans-coloring-in-rustdoc-code-blocks --- src/librustdoc/html/render.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 6234d89024441..29b0c00d11b42 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1818,7 +1818,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context, write!(w, " {name}{unsafety_flag} + title='{title_type} {title}'>{name}{unsafety_flag} {stab_docs} {docs} @@ -1830,6 +1830,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context, stab = myitem.stability_class(), unsafety_flag = unsafety_flag, href = item_path(myitem.type_(), myitem.name.as_ref().unwrap()), + title_type = myitem.type_(), title = full_path(cx, myitem))?; } } From bc4ad1a2c9fb4a9f9f4793e0b62404f3e6150132 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 9 Feb 2017 11:02:01 -0700 Subject: [PATCH 2/2] Add the short type to inline links, too --- src/librustdoc/html/format.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index c591c09bf20e2..6f8c6aa7094dd 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -550,8 +550,8 @@ impl<'a> fmt::Display for HRef<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match href(self.did) { Some((url, shortty, fqp)) => if !f.alternate() { - write!(f, "{}", - shortty, url, fqp.join("::"), self.text) + write!(f, "{}", + shortty, url, shortty, fqp.join("::"), self.text) } else { write!(f, "{}", self.text) },