Skip to content

Commit bf4a984

Browse files
Reduce search-index.js size
1 parent 747a5e5 commit bf4a984

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

Cargo.lock

+6-6
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)",
@@ -1813,7 +1813,7 @@ name = "rand_chacha"
18131813
version = "0.1.0"
18141814
source = "registry+https://github.com/rust-lang/crates.io-index"
18151815
dependencies = [
1816-
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
1816+
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
18171817
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
18181818
]
18191819

@@ -1835,7 +1835,7 @@ name = "rand_hc"
18351835
version = "0.1.0"
18361836
source = "registry+https://github.com/rust-lang/crates.io-index"
18371837
dependencies = [
1838-
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
1838+
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
18391839
]
18401840

18411841
[[package]]
@@ -1860,7 +1860,7 @@ name = "rand_xorshift"
18601860
version = "0.1.0"
18611861
source = "registry+https://github.com/rust-lang/crates.io-index"
18621862
dependencies = [
1863-
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
1863+
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
18641864
]
18651865

18661866
[[package]]
@@ -2682,7 +2682,7 @@ dependencies = [
26822682
name = "rustdoc"
26832683
version = "0.0.0"
26842684
dependencies = [
2685-
"minifier 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)",
2685+
"minifier 0.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
26862686
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
26872687
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
26882688
"tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3497,7 +3497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
34973497
"checksum memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a3eb002f0535929f1199681417029ebea04aadc0c7a4224b46be99c7f5d6a16"
34983498
"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
34993499
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
3500-
"checksum minifier 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)" = "96c269bb45c39b333392b2b18ad71760b34ac65666591386b0e959ed58b3f474"
3500+
"checksum minifier 0.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "9707d0ff1b828cba09c4bb27d5c3dceb6f49bd46f700042343bea350a131bf4f"
35013501
"checksum miniz-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0300eafb20369952951699b68243ab4334f4b10a88f411c221d444b36c40e649"
35023502
"checksum miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad30a47319c16cde58d0314f5d98202a80c9083b5f61178457403dfb14e509c"
35033503
"checksum miniz_oxide_c_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "28edaef377517fd9fe3e085c37d892ce7acd1fbeab9239c5a36eec352d8a8b7e"

src/librustdoc/Cargo.toml

+1-1
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

+4-1
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)