Skip to content

Commit 85aca23

Browse files
committed
Clean up function declarations
1 parent 1b4b78d commit 85aca23

File tree

1 file changed

+9
-9
lines changed
  • src/librustdoc/html/static/js

1 file changed

+9
-9
lines changed

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -1811,7 +1811,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
18111811
// from settings.js, which uses a separate function. It's done here because
18121812
// the minimum sidebar size is rather uncomfortable, and it must pass
18131813
// through that size when using the shrink-to-nothing gesture.
1814-
const hideSidebar = function hideSidebar() {
1814+
const hideSidebar = function() {
18151815
if (isSrcPage) {
18161816
window.rustdocCloseSourceSidebar();
18171817
updateLocalStorage("src-sidebar-width", null);
@@ -1844,7 +1844,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
18441844
// the visible range without releasing it. You can, however, grab the
18451845
// resize handle on a source page with the sidebar closed, because it
18461846
// remains visible all the time on there.
1847-
const showSidebar = function showSidebar() {
1847+
const showSidebar = function() {
18481848
if (isSrcPage) {
18491849
window.rustdocShowSourceSidebar();
18501850
} else {
@@ -1859,7 +1859,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
18591859
*
18601860
* @param {number} size - CSS px width of the sidebar.
18611861
*/
1862-
const changeSidebarSize = function changeSidebarSize(size) {
1862+
const changeSidebarSize = function(size) {
18631863
if (isSrcPage) {
18641864
updateLocalStorage("src-sidebar-width", size.toString());
18651865
// [RUSTDOCIMPL] CSS variable fast path
@@ -1879,11 +1879,11 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
18791879

18801880
// Check if the sidebar is hidden. Since src pages and doc pages have
18811881
// different settings, this function has to check that.
1882-
function isSidebarHidden() {
1882+
const isSidebarHidden = function() {
18831883
return isSrcPage ?
18841884
!hasClass(document.documentElement, "src-sidebar-expanded") :
18851885
hasClass(document.documentElement, "hide-sidebar");
1886-
}
1886+
};
18871887

18881888
/**
18891889
* Respond to the resize handle event.
@@ -1892,7 +1892,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
18921892
*
18931893
* @param {PointerEvent} e
18941894
*/
1895-
function resize(e) {
1895+
const resize = function(e) {
18961896
if (currentPointerId === null || currentPointerId !== e.pointerId) {
18971897
return;
18981898
}
@@ -1923,7 +1923,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
19231923
);
19241924
}, 100);
19251925
}
1926-
}
1926+
};
19271927
// Respond to the window resize event.
19281928
window.addEventListener("resize", () => {
19291929
if (window.innerWidth < RUSTDOC_MOBILE_BREAKPOINT) {
@@ -1940,7 +1940,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
19401940
/**
19411941
* @param {PointerEvent=} e
19421942
*/
1943-
const stopResize = function stopResize(e) {
1943+
const stopResize = function(e) {
19441944
if (currentPointerId === null) {
19451945
return;
19461946
}
@@ -1962,7 +1962,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
19621962
/**
19631963
* @param {PointerEvent} e
19641964
*/
1965-
const initResize = function initResize(e) {
1965+
const initResize = function(e) {
19661966
if (currentPointerId !== null || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
19671967
return;
19681968
}

0 commit comments

Comments
 (0)