Skip to content

Commit 5b8be1a

Browse files
Rollup merge of rust-lang#62392 - GuillaumeGomez:update-minifier, r=GuillaumeGomez
Update minifier-rs version The `main.js` file size goes from 52868 to 50134. A few fixes have been included as well (no more eluded parts of js files). r? @QuietMisdreavus
2 parents c43753f + 0bf81d3 commit 5b8be1a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Cargo.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ dependencies = [
16921692

16931693
[[package]]
16941694
name = "minifier"
1695-
version = "0.0.30"
1695+
version = "0.0.33"
16961696
source = "registry+https://github.com/rust-lang/crates.io-index"
16971697
dependencies = [
16981698
"macro-utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3201,7 +3201,7 @@ dependencies = [
32013201
name = "rustdoc"
32023202
version = "0.0.0"
32033203
dependencies = [
3204-
"minifier 0.0.30 (registry+https://github.com/rust-lang/crates.io-index)",
3204+
"minifier 0.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
32053205
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
32063206
"pulldown-cmark 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
32073207
"rustc-rayon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -4442,7 +4442,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
44424442
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
44434443
"checksum mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "3e27ca21f40a310bd06d9031785f4801710d566c184a6e15bad4f1d9b65f9425"
44444444
"checksum mime_guess 2.0.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)" = "30de2e4613efcba1ec63d8133f344076952090c122992a903359be5a4f99c3ed"
4445-
"checksum minifier 0.0.30 (registry+https://github.com/rust-lang/crates.io-index)" = "4c909e78edf61f3aa0dd2086da168cdf304329044bbf248768ca3d20253ec8c0"
4445+
"checksum minifier 0.0.33 (registry+https://github.com/rust-lang/crates.io-index)" = "70bf0db2475f5e627787da77ca52fe33c294063f49f4134b8bc662eedb5e7332"
44464446
"checksum miniz-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0300eafb20369952951699b68243ab4334f4b10a88f411c221d444b36c40e649"
44474447
"checksum miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad30a47319c16cde58d0314f5d98202a80c9083b5f61178457403dfb14e509c"
44484448
"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
@@ -10,7 +10,7 @@ path = "lib.rs"
1010

1111
[dependencies]
1212
pulldown-cmark = { version = "0.5.3", default-features = false }
13-
minifier = "0.0.30"
13+
minifier = "0.0.33"
1414
rayon = { version = "0.2.0", package = "rustc-rayon" }
1515
tempfile = "3"
1616
parking_lot = "0.7"

src/librustdoc/html/render.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1322,13 +1322,13 @@ fn write_minify_replacer<W: Write>(
13221322
{
13231323
let tokens: Tokens<'_> = simple_minify(contents)
13241324
.into_iter()
1325-
.filter(|f| {
1325+
.filter(|(f, next)| {
13261326
// We keep backlines.
1327-
minifier::js::clean_token_except(f, &|c: &Token<'_>| {
1327+
minifier::js::clean_token_except(f, next, &|c: &Token<'_>| {
13281328
c.get_char() != Some(ReservedChar::Backline)
13291329
})
13301330
})
1331-
.map(|f| {
1331+
.map(|(f, _)| {
13321332
minifier::js::replace_token_with(f, &|t: &Token<'_>| {
13331333
match *t {
13341334
Token::Keyword(Keyword::Null) => Some(Token::Other("N")),
@@ -1363,7 +1363,7 @@ fn write_minify_replacer<W: Write>(
13631363
// shouldn't be aggregated.
13641364
|tokens, pos| {
13651365
pos < 2 ||
1366-
!tokens[pos - 1].is_char(ReservedChar::OpenBracket) ||
1366+
!tokens[pos - 1].eq_char(ReservedChar::OpenBracket) ||
13671367
tokens[pos - 2].get_other() != Some("searchIndex")
13681368
}
13691369
)

0 commit comments

Comments
 (0)