about summary refs log tree commit diff
path: root/src/librustdoc/html/static
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-11-18 11:04:53 -0700
committerMichael Howell <michael@notriddle.com>2022-11-18 11:04:53 -0700
commit7db7cbd49f89ed38212cb062605eaaced2e1bc79 (patch)
tree32192166ece7d2bab131330d384a0d15caa74352 /src/librustdoc/html/static
parentfd3bfb35511cbcff59ce1454d3db627b576d7e92 (diff)
downloadrust-7db7cbd49f89ed38212cb062605eaaced2e1bc79.tar.gz
rust-7db7cbd49f89ed38212cb062605eaaced2e1bc79.zip
rustdoc: remove unused JS IIFE from main.js
This [IIFE] made sense when it was added in
deaf5e200e79a75ac57d3f0952f6758a38168e52 and there was a local variable
scoped to it, but now it calls a function, but declares nothing.

[IIFE]: https://developer.mozilla.org/en-US/docs/Glossary/IIFE "immediately invoked function expression"
Diffstat (limited to 'src/librustdoc/html/static')
-rw-r--r--src/librustdoc/html/static/js/main.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index 874f130d7e2..da08c33e27f 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -723,12 +723,9 @@ function loadCss(cssUrl) {
         });
     };
 
-    (function() {
-        // To avoid checking on "rustdoc-line-numbers" value on every loop...
-        if (getSettingValue("line-numbers") === "true") {
-            window.rustdoc_add_line_numbers_to_examples();
-        }
-    }());
+    if (getSettingValue("line-numbers") === "true") {
+        window.rustdoc_add_line_numbers_to_examples();
+    }
 
     let oldSidebarScrollPosition = null;