Skip to content

Commit 16bb79a

Browse files
committed
Remove Regex::with_size_limit.
This is replaced by using RegexBuilder. Fixes #166
1 parent 47bd416 commit 16bb79a

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

src/re_bytes.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,7 @@ impl Regex {
7777
///
7878
/// If an invalid expression is given, then an error is returned.
7979
pub fn new(re: &str) -> Result<Regex, Error> {
80-
Regex::with_size_limit(10 * (1 << 20), re)
81-
}
82-
83-
/// Compiles a regular expression with the given size limit.
84-
///
85-
/// The size limit is applied to the size of the *compiled* data structure.
86-
/// If the data structure exceeds the size given, then an error is
87-
/// returned.
88-
pub fn with_size_limit(size: usize, re: &str) -> Result<Regex, Error> {
89-
RegexBuilder::new(re).size_limit(size).compile()
80+
RegexBuilder::new(re).compile()
9081
}
9182

9283
/// Returns true if and only if the regex matches the string given.

src/re_unicode.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,7 @@ impl Regex {
151151
///
152152
/// If an invalid expression is given, then an error is returned.
153153
pub fn new(re: &str) -> Result<Regex, Error> {
154-
Regex::with_size_limit(10 * (1 << 20), re)
155-
}
156-
157-
/// Compiles a regular expression with the given size limit.
158-
///
159-
/// The size limit is applied to the size of the *compiled* data structure.
160-
/// If the data structure exceeds the size given, then an error is
161-
/// returned.
162-
pub fn with_size_limit(size: usize, re: &str) -> Result<Regex, Error> {
163-
RegexBuilder::new(re).size_limit(size).compile()
154+
RegexBuilder::new(re).compile()
164155
}
165156

166157
/// Returns true if and only if the regex matches the string given.

0 commit comments

Comments
 (0)