Skip to content

Commit

Permalink
rustdoc: remove unused JS IIFE from main.js
Browse files Browse the repository at this point in the history
This [IIFE] made sense when it was added in
deaf5e2 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"
  • Loading branch information
notriddle committed Nov 18, 2022
1 parent fd3bfb3 commit 7db7cbd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7db7cbd

Please sign in to comment.