Skip to content

Commit fa9c823

Browse files
Fix invalid JS file generation
1 parent b998995 commit fa9c823

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustdoc/html/render.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -868,10 +868,10 @@ themePicker.onblur = handleThemeButtonsBlur;
868868
}
869869

870870
{
871-
let mut data = static_files::STORAGE_JS.to_owned();
872-
data.push_str(&format!("var resourcesSuffix = \"{}\";", cx.shared.resource_suffix));
873871
write_minify(cx.dst.join(&format!("storage{}.js", cx.shared.resource_suffix)),
874-
&data,
872+
&format!("var resourcesSuffix = \"{}\";{}",
873+
cx.shared.resource_suffix,
874+
static_files::STORAGE_JS),
875875
options.enable_minification)?;
876876
}
877877

src/librustdoc/html/static/storage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function switchTheme(styleElem, mainStyleElem, newTheme) {
111111

112112
var found = false;
113113
if (savedHref.length === 0) {
114-
onEach(document.getElementsByTagName("link"), function(el) {
114+
onEachLazy(document.getElementsByTagName("link"), function(el) {
115115
savedHref.push(el.href);
116116
});
117117
}

0 commit comments

Comments
 (0)