cur: str::CharOffsets<'a>,
depth: uint,
/// Error messages accumulated during parsing
- pub errors: Vec<~str>,
+ pub errors: Vec<StrBuf>,
}
impl<'a> Iterator<Piece<'a>> for Parser<'a> {
}
/// Notifies of an error. The message doesn't actually need to be of type
- /// ~str, but I think it does when this eventually uses conditions so it
+ /// StrBuf, but I think it does when this eventually uses conditions so it
/// might as well start using it now.
fn err(&mut self, msg: &str) {
- self.errors.push(msg.to_owned());
+ self.errors.push(msg.to_strbuf());
}
/// Optionally consumes the specified character. If the character is not at
}
match parser.errors.shift() {
Some(error) => {
- cx.ecx.span_err(efmt.span, "invalid format string: " + error);
+ cx.ecx.span_err(efmt.span,
+ format_strbuf!("invalid format string: {}",
+ error).as_slice());
return DummyResult::raw_expr(sp);
}
None => {}