Skip to content

Commit 81d792f

Browse files
committed
Copy item path rather than full use statement.
1 parent b1f8e27 commit 81d792f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/librustdoc/html/render/print_item.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,10 @@ pub(super) fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer,
8484
write!(buf, "<a class=\"{}\" href=\"#\">{}</a>", item.type_(), item.name.as_ref().unwrap());
8585
write!(
8686
buf,
87-
"<button id=\"copy-path\" onclick=\"copy_path(this)\" title=\"copy path\">\
87+
"<button id=\"copy-path\" onclick=\"copy_path(this)\" title=\"Copy item path to clipboard\">\
8888
<img src=\"{static_root_path}clipboard{suffix}.svg\" \
8989
width=\"19\" height=\"18\" \
90-
alt=\"Copy item import\" \
91-
title=\"Copy item import to clipboard\">\
90+
alt=\"Copy item path\">\
9291
</button>",
9392
static_root_path = page.get_static_root_path(),
9493
suffix = page.resource_suffix,

src/librustdoc/html/static/js/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ function hideThemeButtonState() {
985985
});
986986

987987
var el = document.createElement('textarea');
988-
el.value = 'use ' + path.join('::') + ';';
988+
el.value = path.join('::');
989989
el.setAttribute('readonly', '');
990990
// To not make it appear on the screen.
991991
el.style.position = 'absolute';

0 commit comments

Comments
 (0)