1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-26 12:45:20 +03:00
aports/community/monolith/regex-features.patch
2022-10-08 22:23:47 +02:00

64 lines
1.8 KiB
Diff

Patch-Source: https://github.com/Y2Z/monolith/pull/318
--
From ac69ccecd0849cd6f2c9e1d4c0833ebcbf7a01a4 Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Mon, 19 Sep 2022 22:34:25 +0200
Subject: [PATCH] disable unnecessary/unused regex features to reduce binary
size
This will reduce the monolith binary size by ~15%.
---
Cargo.lock | 11 -----------
Cargo.toml | 7 ++++++-
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 673a549..71e51a9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8,15 +8,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-[[package]]
-name = "aho-corasick"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
-dependencies = [
- "memchr",
-]
-
[[package]]
name = "alloc-no-stdlib"
version = "2.0.3"
@@ -1211,8 +1202,6 @@ version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
dependencies = [
- "aho-corasick",
- "memchr",
"regex-syntax",
]
diff --git a/Cargo.toml b/Cargo.toml
index c3191ec..f39669f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -30,10 +30,15 @@ cssparser = "0.29.6"
encoding_rs = "0.8.31"
html5ever = "0.24.1"
percent-encoding = "2.1.0"
-regex = "1.6.0" # Used for parsing srcset and NOSCRIPT
sha2 = "0.10.2" # Used for calculating checksums during integrity checks
url = "2.2.2"
+# Used for parsing srcset and NOSCRIPT
+[dependencies.regex]
+version = "1.6.0"
+default-features = false
+features = ["std", "perf-dfa", "unicode-perl"]
+
[dependencies.reqwest]
version = "0.11.11"
default-features = false