std: Remove format_strbuf!()
This was only ever a transitionary macro.
This commit is contained in:
@@ -425,7 +425,7 @@ impl Regex {
|
||||
/// # use regex::Captures; fn main() {
|
||||
/// let re = regex!(r"([^,\s]+),\s+(\S+)");
|
||||
/// let result = re.replace("Springsteen, Bruce", |caps: &Captures| {
|
||||
/// format_strbuf!("{} {}", caps.at(2), caps.at(1))
|
||||
/// format!("{} {}", caps.at(2), caps.at(1))
|
||||
/// });
|
||||
/// assert_eq!(result.as_slice(), "Bruce Springsteen");
|
||||
/// # }
|
||||
@@ -761,9 +761,8 @@ impl<'t> Captures<'t> {
|
||||
let re = Regex::new(r"(^|[^$]|\b)\$(\w+)").unwrap();
|
||||
let text = re.replace_all(text, |refs: &Captures| -> String {
|
||||
let (pre, name) = (refs.at(1), refs.at(2));
|
||||
format_strbuf!("{}{}",
|
||||
pre,
|
||||
match from_str::<uint>(name.as_slice()) {
|
||||
format!("{}{}", pre,
|
||||
match from_str::<uint>(name.as_slice()) {
|
||||
None => self.name(name).to_string(),
|
||||
Some(i) => self.at(i).to_string(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user