about summary refs log tree commit diff
diff options
context:
space:
mode:
authormoxian <aleftmail@inbox.ru>2021-07-16 03:45:27 +0000
committermoxian <aleftmail@inbox.ru>2021-07-16 03:45:27 +0000
commit81d792f31d02ac461f5ea3f9f65f14cfc95a0e6f (patch)
treeaffe6b8d85b06201549a752580a1bc0202620716
parentb1f8e27b74c541d3d555149c8efa4bfe9385cd56 (diff)
downloadrust-81d792f31d02ac461f5ea3f9f65f14cfc95a0e6f.tar.gz
rust-81d792f31d02ac461f5ea3f9f65f14cfc95a0e6f.zip
Copy item path rather than full `use` statement.
-rw-r--r--src/librustdoc/html/render/print_item.rs5
-rw-r--r--src/librustdoc/html/static/js/main.js2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index f7073a8751f..58375ab09ad 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -84,11 +84,10 @@ pub(super) fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer,
     write!(buf, "<a class=\"{}\" href=\"#\">{}</a>", item.type_(), item.name.as_ref().unwrap());
     write!(
         buf,
-        "<button id=\"copy-path\" onclick=\"copy_path(this)\" title=\"copy path\">\
+        "<button id=\"copy-path\" onclick=\"copy_path(this)\" title=\"Copy item path to clipboard\">\
             <img src=\"{static_root_path}clipboard{suffix}.svg\" \
                 width=\"19\" height=\"18\" \
-                alt=\"Copy item import\" \
-                title=\"Copy item import to clipboard\">\
+                alt=\"Copy item path\">\
          </button>",
         static_root_path = page.get_static_root_path(),
         suffix = page.resource_suffix,
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index 38ddbb3ad74..5917927fb93 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -985,7 +985,7 @@ function hideThemeButtonState() {
         });
 
         var el = document.createElement('textarea');
-        el.value = 'use ' + path.join('::') + ';';
+        el.value = path.join('::');
         el.setAttribute('readonly', '');
         // To not make it appear on the screen.
         el.style.position = 'absolute';