This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch branch-1.11
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/branch-1.11 by this push:
new 14b9330d0 AVRO-3838: [Rust] Replace "regex" with "regex-lite" (#2460)
14b9330d0 is described below
commit 14b9330d058b47b8b37e1b75354ded73e4b7b8fc
Author: Martin Grigorov <[email protected]>
AuthorDate: Tue Aug 22 10:11:30 2023 +0300
AVRO-3838: [Rust] Replace "regex" with "regex-lite" (#2460)
Reduces the time for `cargo clean && cargo build --release" from 30secs
to 22secs on my dev machine
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
(cherry picked from commit 0f364e389596d96615f4b22d4359eeb35f5dab35)
---
lang/rust/Cargo.lock | 8 +++++++-
lang/rust/avro/Cargo.toml | 2 +-
lang/rust/avro/src/schema.rs | 2 +-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock
index bf7fc242a..fbb4fb941 100644
--- a/lang/rust/Cargo.lock
+++ b/lang/rust/Cargo.lock
@@ -81,7 +81,7 @@ dependencies = [
"pretty_assertions",
"quad-rand",
"rand",
- "regex",
+ "regex-lite",
"serde",
"serde_json",
"sha2",
@@ -883,6 +883,12 @@ dependencies = [
"regex-syntax 0.7.4",
]
+[[package]]
+name = "regex-lite"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f96ede7f386ba6e910092e7ccdc04176cface62abebea07ed6b46d870ed95ca2"
+
[[package]]
name = "regex-syntax"
version = "0.6.29"
diff --git a/lang/rust/avro/Cargo.toml b/lang/rust/avro/Cargo.toml
index 29ef270d8..872753dbf 100644
--- a/lang/rust/avro/Cargo.toml
+++ b/lang/rust/avro/Cargo.toml
@@ -62,7 +62,7 @@ lazy_static = { default-features = false, version = "1.4.0" }
libflate = { default-features = false, version = "2.0.0", features = ["std"] }
log = { default-features = false, version = "0.4.20" }
num-bigint = { default-features = false, version = "0.4.3" }
-regex = { default-features = false, version = "1.9.3", features = ["std",
"perf"] }
+regex-lite = { default-features = false, version = "0.1.0", features = ["std",
"string"] }
serde = { default-features = false, version = "1.0.183", features = ["derive"]
}
serde_json = { default-features = false, version = "1.0.105", features =
["std"] }
snap = { default-features = false, version = "1.1.0", optional = true }
diff --git a/lang/rust/avro/src/schema.rs b/lang/rust/avro/src/schema.rs
index 97cecf127..848c35b95 100644
--- a/lang/rust/avro/src/schema.rs
+++ b/lang/rust/avro/src/schema.rs
@@ -19,7 +19,7 @@
use crate::{error::Error, types, util::MapHelper, AvroResult};
use digest::Digest;
use lazy_static::lazy_static;
-use regex::Regex;
+use regex_lite::Regex;
use serde::{
ser::{SerializeMap, SerializeSeq},
Deserialize, Serialize, Serializer,