Skip to content

Commit 01756e2

Browse files
committed
rustdoc: use functions instead of unnecessary arrows
1 parent 9b81a2a commit 01756e2

File tree

1 file changed

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

1 file changed

+14
-14
lines changed

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

+14-14
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/how-to-read-rustdoc.html\
12461246
return;
12471247
}
12481248
const isSrcPage = hasClass(document.body, "src");
1249-
const hideSidebar = () => {
1249+
function hideSidebar() {
12501250
if (isSrcPage) {
12511251
window.rustdocCloseSourceSidebar();
12521252
updateLocalStorage("src-sidebar-width", null);
@@ -1257,30 +1257,30 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/how-to-read-rustdoc.html\
12571257
updateLocalStorage("desktop-sidebar-width", null);
12581258
document.documentElement.style.removeProperty("--desktop-sidebar-width");
12591259
}
1260-
};
1261-
const showSidebar = () => {
1260+
}
1261+
function showSidebar() {
12621262
if (isSrcPage) {
12631263
window.rustdocShowSourceSidebar();
12641264
} else {
12651265
removeClass(document.documentElement, "hide-sidebar");
12661266
updateLocalStorage("hide-sidebar", "false");
12671267
}
1268-
};
1269-
const changeSidebarSize = size => {
1268+
}
1269+
function changeSidebarSize(size) {
12701270
if (isSrcPage) {
12711271
updateLocalStorage("src-sidebar-width", size);
12721272
document.documentElement.style.setProperty("--src-sidebar-width", size + "px");
12731273
} else {
12741274
updateLocalStorage("desktop-sidebar-width", size);
12751275
document.documentElement.style.setProperty("--desktop-sidebar-width", size + "px");
12761276
}
1277-
};
1278-
const isSidebarHidden = () => {
1277+
}
1278+
function isSidebarHidden() {
12791279
return isSrcPage ?
12801280
!hasClass(document.documentElement, "src-sidebar-expanded") :
12811281
hasClass(document.documentElement, "hide-sidebar");
1282-
};
1283-
const resize = e => {
1282+
}
1283+
function resize(e) {
12841284
if (currentPointerId === null || currentPointerId !== e.pointerId) {
12851285
return;
12861286
}
@@ -1296,8 +1296,8 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/how-to-read-rustdoc.html\
12961296
}
12971297
changeSidebarSize(Math.min(pos, window.innerWidth - 100));
12981298
}
1299-
};
1300-
const stopResize = e => {
1299+
}
1300+
function stopResize(e) {
13011301
if (currentPointerId === null) {
13021302
return;
13031303
}
@@ -1310,8 +1310,8 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/how-to-read-rustdoc.html\
13101310
resizer.releasePointerCapture(currentPointerId);
13111311
currentPointerId = null;
13121312
}
1313-
};
1314-
const initResize = e => {
1313+
}
1314+
function initResize(e) {
13151315
if (currentPointerId !== null || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
13161316
return;
13171317
}
@@ -1331,7 +1331,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/how-to-read-rustdoc.html\
13311331
window.addEventListener("pointerup", stopResize, false);
13321332
addClass(resizer, "active");
13331333
addClass(document.documentElement, "sidebar-resizing");
1334-
};
1334+
}
13351335
resizer.addEventListener("pointerdown", initResize, false);
13361336
}());
13371337

0 commit comments

Comments
 (0)