]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/html/static/js/main.js
Rollup merge of #106477 - Nathan-Fenner:nathanf/refined-error-span-trait-impl, r...
[rust.git] / src / librustdoc / html / static / js / main.js
index 604ab147f6a16ea5a251d6ed4a71aa59f295f9ac..c66f500f42333df8432907e758b771fee142cc5a 100644 (file)
@@ -180,7 +180,6 @@ function browserSupportsHistoryApi() {
     return window.history && typeof window.history.pushState === "function";
 }
 
-// eslint-disable-next-line no-unused-vars
 function loadCss(cssUrl) {
     const link = document.createElement("link");
     link.href = cssUrl;
@@ -1142,7 +1141,11 @@ function loadCss(cssUrl) {
 (function() {
     let reset_button_timeout = null;
 
-    window.copy_path = but => {
+    const but = document.getElementById("copy-path");
+    if (!but) {
+        return;
+    }
+    but.onclick = () => {
         const parent = but.parentElement;
         const path = [];