1
Fork 0

libfmt_macros: Remove all uses of ~str from libfmt_macros

This commit is contained in:
Patrick Walton 2014-05-14 21:01:21 -07:00
parent ce11f19695
commit 67e39a8e76
2 changed files with 6 additions and 4 deletions

View file

@ -203,7 +203,7 @@ pub struct Parser<'a> {
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> {
@ -246,10 +246,10 @@ impl<'a> 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

View file

@ -886,7 +886,9 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span,
}
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 => {}