From 50375139e2bc69920786411f7b1e05866898ed7a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 22 Sep 2014 08:28:35 -0700 Subject: Deal with the fallout of string stabilization --- src/libregex/compile.rs | 2 +- src/libregex/re.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/libregex') diff --git a/src/libregex/compile.rs b/src/libregex/compile.rs index 91c3da00162..a0fefd24214 100644 --- a/src/libregex/compile.rs +++ b/src/libregex/compile.rs @@ -105,7 +105,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 c2578d227ee..0c9b3a79bdf 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 } @@ -504,7 +504,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. -- cgit 1.4.1-3-g733a5