Skip to content

Commit 0d26ce9

Browse files
authored
Rollup merge of rust-lang#56869 - GuillaumeGomez:index-size-reduction, 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
2 parents 06b0f46 + bf4a984 commit 0d26ce9

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
13341334

13351335
[[package]]
13361336
name = "minifier"
1337-
version = "0.0.20"
1337+
version = "0.0.21"
13381338
source = "registry+https://github.com/rust-lang/crates.io-index"
13391339
dependencies = [
13401340
"macro-utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2686,7 +2686,7 @@ dependencies = [
26862686
name = "rustdoc"
26872687
version = "0.0.0"
26882688
dependencies = [
2689-
"minifier 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)",
2689+
"minifier 0.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
26902690
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
26912691
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
26922692
"tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3502,7 +3502,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
35023502
"checksum memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a3eb002f0535929f1199681417029ebea04aadc0c7a4224b46be99c7f5d6a16"
35033503
"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
35043504
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
3505-
"checksum minifier 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)" = "96c269bb45c39b333392b2b18ad71760b34ac65666591386b0e959ed58b3f474"
3505+
"checksum minifier 0.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "9707d0ff1b828cba09c4bb27d5c3dceb6f49bd46f700042343bea350a131bf4f"
35063506
"checksum miniz-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0300eafb20369952951699b68243ab4334f4b10a88f411c221d444b36c40e649"
35073507
"checksum miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad30a47319c16cde58d0314f5d98202a80c9083b5f61178457403dfb14e509c"
35083508
"checksum miniz_oxide_c_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "28edaef377517fd9fe3e085c37d892ce7acd1fbeab9239c5a36eec352d8a8b7e"

src/librustdoc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ path = "lib.rs"
99

1010
[dependencies]
1111
pulldown-cmark = { version = "0.1.2", default-features = false }
12-
minifier = "0.0.20"
12+
minifier = "0.0.21"
1313
tempfile = "3"
1414
parking_lot = "0.6.4"

src/librustdoc/html/render.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,10 @@ fn write_minify_replacer<W: Write>(dst: &mut W,
12211221
-> io::Result<()> {
12221222
if enable_minification {
12231223
writeln!(dst, "{}",
1224-
minifier::js::minify_and_replace_keywords(contents, keywords_to_replace))
1224+
minifier::js::minify_and_replace_keywords(contents, keywords_to_replace)
1225+
.apply(minifier::js::clean_tokens)
1226+
.apply(minifier::js::aggregate_strings)
1227+
.to_string())
12251228
} else {
12261229
writeln!(dst, "{}", contents)
12271230
}

0 commit comments

Comments
 (0)