Skip to content

Commit

Permalink
Remove Regex::with_size_limit.
Browse files Browse the repository at this point in the history
This is replaced by using RegexBuilder.

Fixes #166
  • Loading branch information
BurntSushi committed Aug 5, 2016
1 parent 47bd416 commit 16bb79a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
11 changes: 1 addition & 10 deletions src/re_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,7 @@ impl Regex {
///
/// If an invalid expression is given, then an error is returned.
pub fn new(re: &str) -> Result<Regex, Error> {
Regex::with_size_limit(10 * (1 << 20), re)
}

/// Compiles a regular expression with the given size limit.
///
/// The size limit is applied to the size of the *compiled* data structure.
/// If the data structure exceeds the size given, then an error is
/// returned.
pub fn with_size_limit(size: usize, re: &str) -> Result<Regex, Error> {
RegexBuilder::new(re).size_limit(size).compile()
RegexBuilder::new(re).compile()
}

/// Returns true if and only if the regex matches the string given.
Expand Down
11 changes: 1 addition & 10 deletions src/re_unicode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,7 @@ impl Regex {
///
/// If an invalid expression is given, then an error is returned.
pub fn new(re: &str) -> Result<Regex, Error> {
Regex::with_size_limit(10 * (1 << 20), re)
}

/// Compiles a regular expression with the given size limit.
///
/// The size limit is applied to the size of the *compiled* data structure.
/// If the data structure exceeds the size given, then an error is
/// returned.
pub fn with_size_limit(size: usize, re: &str) -> Result<Regex, Error> {
RegexBuilder::new(re).size_limit(size).compile()
RegexBuilder::new(re).compile()
}

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

0 comments on commit 16bb79a

Please sign in to comment.