Skip to content

Commit 42a4aa9

Browse files
committed
Add unicode feature to switch between regex and regex-lite dep
1 parent 0335bfb commit 42a4aa9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ edition = "2018"
1313
[dependencies]
1414
encoding_rs = "0.8.32"
1515
lazy_static = "1.4.0"
16-
regex = "1.5.5"
16+
regex = { version = "1.5.5", optional = true }
17+
regex-lite = { version = "0.1" }
18+
19+
[features]
20+
default = ["unicode"]
21+
unicode = ["dep:regex"]

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ use encoding_rs::EncoderResult;
7171
use encoding_rs::Encoding;
7272
use encoding_rs::WINDOWS_1252;
7373
use lazy_static::lazy_static;
74+
#[cfg(feature = "unicode")]
7475
use regex::Regex;
76+
#[cfg(not(feature = "unicode"))]
77+
use regex_lite::Regex;
7578
use std::collections::HashMap;
7679
use std::collections::VecDeque;
7780
use std::convert::From;

0 commit comments

Comments
 (0)