From b5ae4d58883151a977487de86856d9529df9d948 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 22 Feb 2019 13:50:17 +0100 Subject: [PATCH] Don't generate minification variable if minification disabled --- src/librustdoc/html/render.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index d037154272db6..418289f98ea2e 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1117,7 +1117,11 @@ themePicker.onblur = handleThemeButtonsBlur; // with rustdoc running in parallel. all_indexes.sort(); let mut w = try_err!(File::create(&dst), &dst); - try_err!(writeln!(&mut w, "var N=null,E=\"\",T=\"t\",U=\"u\",searchIndex={{}};"), &dst); + if options.enable_minification { + try_err!(writeln!(&mut w, "var N=null,E=\"\",T=\"t\",U=\"u\",searchIndex={{}};"), &dst); + } else { + try_err!(writeln!(&mut w, "var searchIndex={{}};"), &dst); + } try_err!(write_minify_replacer(&mut w, &format!("{}\n{}", variables.join(""), all_indexes.join("\n")), options.enable_minification),