Update to regex 0.2.

This commit is contained in:
Andrew Gallant
2016-12-30 16:24:09 -05:00
parent d58236fbdc
commit 163e00677a
14 changed files with 335 additions and 61 deletions

View File

@@ -24,7 +24,7 @@ fnv = "1.0"
lazy_static = "0.2"
log = "0.3"
memchr = "1"
regex = "0.1.77"
regex = "0.2.0"
[dev-dependencies]
glob = "0.2"

View File

@@ -666,7 +666,7 @@ fn bytes_to_escaped_literal(bs: &[u8]) -> String {
let mut s = String::with_capacity(bs.len());
for &b in bs {
if b <= 0x7F {
s.push_str(&regex::quote(&(b as char).to_string()));
s.push_str(&regex::escape(&(b as char).to_string()));
} else {
s.push_str(&format!("\\x{:02x}", b));
}

View File

@@ -202,7 +202,7 @@ fn new_regex(pat: &str) -> Result<Regex, Error> {
.dot_matches_new_line(true)
.size_limit(10 * (1 << 20))
.dfa_size_limit(10 * (1 << 20))
.compile()
.build()
.map_err(|err| Error::Regex(err.to_string()))
}