diff options
| author | Richo Healey <richo@psych0tik.net> | 2014-05-25 03:17:19 -0700 |
|---|---|---|
| committer | Richo Healey <richo@psych0tik.net> | 2014-05-27 12:59:31 -0700 |
| commit | 1f1b2e42d76ba1cd884adc49922636a6c2ac1b2f (patch) | |
| tree | 2a56d5ceda84c1a58796fe0fc4e7cea38a9336f6 /src/libregex | |
| parent | 4348e23b269739657d934b532ad061bfd6d92309 (diff) | |
| download | rust-1f1b2e42d76ba1cd884adc49922636a6c2ac1b2f.tar.gz rust-1f1b2e42d76ba1cd884adc49922636a6c2ac1b2f.zip | |
std: Rename strbuf operations to string
[breaking-change]
Diffstat (limited to 'src/libregex')
| -rw-r--r-- | src/libregex/parse/mod.rs | 8 | ||||
| -rw-r--r-- | src/libregex/re.rs | 10 | ||||
| -rw-r--r-- | src/libregex/test/bench.rs | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/libregex/parse/mod.rs b/src/libregex/parse/mod.rs index bc365582ca4..87b6e2b1104 100644 --- a/src/libregex/parse/mod.rs +++ b/src/libregex/parse/mod.rs @@ -222,7 +222,7 @@ impl<'a> Parser<'a> { self.caps += 1; self.stack.push(Paren(self.flags, self.caps, - "".to_strbuf())) + "".to_string())) } } ')' => { @@ -796,7 +796,7 @@ impl<'a> Parser<'a> { } if self.cur() == ':' { // Save the old flags with the opening paren. - self.stack.push(Paren(self.flags, 0, "".to_strbuf())); + self.stack.push(Paren(self.flags, 0, "".to_string())); } self.flags = flags; return Ok(()) @@ -922,7 +922,7 @@ impl<'a> Parser<'a> { fn err<T>(&self, msg: &str) -> Result<T, Error> { Err(Error { pos: self.chari, - msg: msg.to_strbuf(), + msg: msg.to_string(), }) } @@ -942,7 +942,7 @@ impl<'a> Parser<'a> { } fn slice(&self, start: uint, end: uint) -> String { - str::from_chars(self.chars.as_slice().slice(start, end)).to_strbuf() + str::from_chars(self.chars.as_slice().slice(start, end)).to_string() } } diff --git a/src/libregex/re.rs b/src/libregex/re.rs index 91b24888c24..5958089a8a4 100644 --- a/src/libregex/re.rs +++ b/src/libregex/re.rs @@ -154,7 +154,7 @@ impl Regex { let ast = try!(parse::parse(re)); let (prog, names) = Program::new(ast); Ok(Dynamic(Dynamic { - original: re.to_strbuf(), + original: re.to_string(), names: names, prog: prog, })) @@ -539,8 +539,8 @@ enum NamesIter<'a> { impl<'a> Iterator<Option<String>> for NamesIter<'a> { fn next(&mut self) -> Option<Option<String>> { match *self { - NamesIterNative(ref mut i) => i.next().map(|x| x.map(|s| s.to_strbuf())), - NamesIterDynamic(ref mut i) => i.next().map(|x| x.as_ref().map(|s| s.to_strbuf())), + NamesIterNative(ref mut i) => i.next().map(|x| x.map(|s| s.to_string())), + NamesIterDynamic(ref mut i) => i.next().map(|x| x.as_ref().map(|s| s.to_string())), } } } @@ -764,8 +764,8 @@ impl<'t> Captures<'t> { format_strbuf!("{}{}", pre, match from_str::<uint>(name.as_slice()) { - None => self.name(name).to_strbuf(), - Some(i) => self.at(i).to_strbuf(), + None => self.name(name).to_string(), + Some(i) => self.at(i).to_string(), }) }); let re = Regex::new(r"\$\$").unwrap(); diff --git a/src/libregex/test/bench.rs b/src/libregex/test/bench.rs index 5bbb37c2490..8dc6484a136 100644 --- a/src/libregex/test/bench.rs +++ b/src/libregex/test/bench.rs @@ -161,7 +161,7 @@ fn gen_text(n: uint) -> String { *b = '\n' as u8 } } - str::from_utf8(bytes.as_slice()).unwrap().to_strbuf() + str::from_utf8(bytes.as_slice()).unwrap().to_string() } throughput!(easy0_32, easy0(), 32) |
