Skip to content

Commit 67e39a8

Browse files
committed
libfmt_macros: Remove all uses of ~str from libfmt_macros
1 parent ce11f19 commit 67e39a8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/libfmt_macros/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub struct Parser<'a> {
203203
cur: str::CharOffsets<'a>,
204204
depth: uint,
205205
/// Error messages accumulated during parsing
206-
pub errors: Vec<~str>,
206+
pub errors: Vec<StrBuf>,
207207
}
208208

209209
impl<'a> Iterator<Piece<'a>> for Parser<'a> {
@@ -246,10 +246,10 @@ impl<'a> Parser<'a> {
246246
}
247247

248248
/// Notifies of an error. The message doesn't actually need to be of type
249-
/// ~str, but I think it does when this eventually uses conditions so it
249+
/// StrBuf, but I think it does when this eventually uses conditions so it
250250
/// might as well start using it now.
251251
fn err(&mut self, msg: &str) {
252-
self.errors.push(msg.to_owned());
252+
self.errors.push(msg.to_strbuf());
253253
}
254254

255255
/// Optionally consumes the specified character. If the character is not at

src/libsyntax/ext/format.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,9 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span,
886886
}
887887
match parser.errors.shift() {
888888
Some(error) => {
889-
cx.ecx.span_err(efmt.span, "invalid format string: " + error);
889+
cx.ecx.span_err(efmt.span,
890+
format_strbuf!("invalid format string: {}",
891+
error).as_slice());
890892
return DummyResult::raw_expr(sp);
891893
}
892894
None => {}

0 commit comments

Comments
 (0)