Skip to content

Commit

Permalink
Rollup merge of rust-lang#56869 - GuillaumeGomez:index-size-reduction…
Browse files Browse the repository at this point in the history
…, r=QuietMisdreavus

Reduce search-index.js size

Coming from:

```
1735683 Dec 16 01:35 build/x86_64-apple-darwin/doc/search-index.js
```

to:

```
727755 Dec 16 01:51 build/x86_64-apple-darwin/doc/search-index.js
```

r? @QuietMisdreavus
  • Loading branch information
Centril committed Dec 22, 2018
2 parents 06b0f46 + bf4a984 commit 0d26ce9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "minifier"
version = "0.0.20"
version = "0.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"macro-utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -2686,7 +2686,7 @@ dependencies = [
name = "rustdoc"
version = "0.0.0"
dependencies = [
"minifier 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)",
"minifier 0.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -3502,7 +3502,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a3eb002f0535929f1199681417029ebea04aadc0c7a4224b46be99c7f5d6a16"
"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
"checksum minifier 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)" = "96c269bb45c39b333392b2b18ad71760b34ac65666591386b0e959ed58b3f474"
"checksum minifier 0.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "9707d0ff1b828cba09c4bb27d5c3dceb6f49bd46f700042343bea350a131bf4f"
"checksum miniz-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0300eafb20369952951699b68243ab4334f4b10a88f411c221d444b36c40e649"
"checksum miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad30a47319c16cde58d0314f5d98202a80c9083b5f61178457403dfb14e509c"
"checksum miniz_oxide_c_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "28edaef377517fd9fe3e085c37d892ce7acd1fbeab9239c5a36eec352d8a8b7e"
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ path = "lib.rs"

[dependencies]
pulldown-cmark = { version = "0.1.2", default-features = false }
minifier = "0.0.20"
minifier = "0.0.21"
tempfile = "3"
parking_lot = "0.6.4"
5 changes: 4 additions & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,10 @@ fn write_minify_replacer<W: Write>(dst: &mut W,
-> io::Result<()> {
if enable_minification {
writeln!(dst, "{}",
minifier::js::minify_and_replace_keywords(contents, keywords_to_replace))
minifier::js::minify_and_replace_keywords(contents, keywords_to_replace)
.apply(minifier::js::clean_tokens)
.apply(minifier::js::aggregate_strings)
.to_string())
} else {
writeln!(dst, "{}", contents)
}
Expand Down

0 comments on commit 0d26ce9

Please sign in to comment.