about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2019-01-10 21:26:41 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2019-01-17 01:41:01 +0100
commit2e8fd44598f730d6a79e5fdabefcb26034fc093a (patch)
tree7b02378ef3ea2cd0f741af18ffca8c4f4eeac265 /src
parentf42407f11401eecccda3a641a59c0a60f46b957e (diff)
downloadrust-2e8fd44598f730d6a79e5fdabefcb26034fc093a.tar.gz
rust-2e8fd44598f730d6a79e5fdabefcb26034fc093a.zip
Minify search-index in one pass
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/render.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 2552c971794..26512d93655 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1057,11 +1057,11 @@ themePicker.onblur = handleThemeButtonsBlur;
     all_indexes.sort();
     let mut w = try_err!(File::create(&dst), &dst);
     try_err!(writeln!(&mut w, "var N = null;var searchIndex = {{}};"), &dst);
-    for index in &all_indexes {
-        try_err!(write_minify_replacer(&mut w, &*index, options.enable_minification,
-                                       &[(minifier::js::Keyword::Null, "N")]),
-                 &dst);
-    }
+    try_err!(write_minify_replacer(&mut w,
+                                   &all_indexes.join("\n"),
+                                   options.enable_minification,
+                                   &[(minifier::js::Keyword::Null, "N")]),
+             &dst);
     try_err!(writeln!(&mut w, "initSearch(searchIndex);addSearchOptions(searchIndex);"), &dst);
 
     if options.enable_index_page {