about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-02-23 09:25:33 +0100
committerGitHub <noreply@github.com>2019-02-23 09:25:33 +0100
commit69cb908849958f803a2c3cf072573d3d8dadda0e (patch)
treefe7b56c071e2d05d45c6a0a9d7d31e32244f11f2 /src
parent93bfa92a3dc698261b6a76d546e8018b023b443c (diff)
parentb5ae4d58883151a977487de86856d9529df9d948 (diff)
downloadrust-69cb908849958f803a2c3cf072573d3d8dadda0e.tar.gz
rust-69cb908849958f803a2c3cf072573d3d8dadda0e.zip
Rollup merge of #58643 - GuillaumeGomez:extra-variables, r=Manishearth
Don't generate minification variables if minification disabled

If the minification is disabled, there is no sense having those variables.

r? @QuietMisdreavus
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/render.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 5109e775ebf..d711e4514a0 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),