about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorJacob Hoffman-Andrews <github@hoffman-andrews.com>2022-01-11 14:39:51 -0800
committerJacob Hoffman-Andrews <github@hoffman-andrews.com>2022-01-14 10:41:30 -0800
commit7781636fc7bd2edc6bf314dc15eb8e9d5cb60ce6 (patch)
treeb80cb6641ad641657d3b80944604409b051eb43c /src/librustdoc/html/render
parent256721ee519f6ff15dc5c1cfaf3ebf9af75efa4a (diff)
downloadrust-7781636fc7bd2edc6bf314dc15eb8e9d5cb60ce6.tar.gz
rust-7781636fc7bd2edc6bf314dc15eb8e9d5cb60ce6.zip
Link sidebar "location" heading to top of page
This makes it easy, when you are scrolled far down in a page, to jump
back to the top.
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index dda74904931..0fdf67124c1 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -1737,7 +1737,7 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {
     {
         write!(
             buffer,
-            "<h2 class=\"location\">{}{}</h2>",
+            "<h2 class=\"location\"><a href=\"#\">{}{}</a></h2>",
             match *it.kind {
                 clean::StructItem(..) => "Struct ",
                 clean::TraitItem(..) => "Trait ",