Skip to content

Commit

Permalink
Rollup merge of rust-lang#104459 - notriddle:notriddle/main-js-iife, …
Browse files Browse the repository at this point in the history
…r=GuillaumeGomez

rustdoc: remove unused JS IIFE from main.js

This [IIFE] made sense when it was added in f0683f9 and there was a local variable scoped to it, but now it only sets two globals, so it does nothing.

[IIFE]: https://developer.mozilla.org/en-US/docs/Glossary/IIFE "immediately invoked function expression"
  • Loading branch information
matthiaskrgr authored Nov 16, 2022
2 parents 0815d3a + 5649cbb commit 2b90e24
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ function blurHandler(event, parentElem, hideCallback) {
}
}

(function() {
window.rootPath = getVar("root-path");
window.currentCrate = getVar("current-crate");
}());
window.rootPath = getVar("root-path");
window.currentCrate = getVar("current-crate");

function setMobileTopbar() {
// FIXME: It would be nicer to generate this text content directly in HTML,
Expand Down

0 comments on commit 2b90e24

Please sign in to comment.