diff options
Diffstat (limited to 'src/libregex')
| -rw-r--r-- | src/libregex/compile.rs | 2 | ||||
| -rw-r--r-- | src/libregex/re.rs | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/libregex/compile.rs b/src/libregex/compile.rs index 14d32ed6eaa..c3e195af6f9 100644 --- a/src/libregex/compile.rs +++ b/src/libregex/compile.rs @@ -104,7 +104,7 @@ impl Program { let mut pre = String::with_capacity(5); for inst in c.insts.slice_from(1).iter() { match *inst { - OneChar(c, FLAG_EMPTY) => pre.push_char(c), + OneChar(c, FLAG_EMPTY) => pre.push(c), _ => break } } diff --git a/src/libregex/re.rs b/src/libregex/re.rs index 32a88cfb76d..0b5aeb215e6 100644 --- a/src/libregex/re.rs +++ b/src/libregex/re.rs @@ -26,9 +26,9 @@ pub fn quote(text: &str) -> String { let mut quoted = String::with_capacity(text.len()); for c in text.chars() { if parse::is_punct(c) { - quoted.push_char('\\') + quoted.push('\\') } - quoted.push_char(c); + quoted.push(c); } quoted } @@ -503,7 +503,8 @@ impl Regex { new.push_str(rep.reg_replace(&cap).as_slice()); last_match = e; } - new.append(text.slice(last_match, text.len())) + new.push_str(text.slice(last_match, text.len())); + return new; } /// Returns the original string of this regex. |
