Skip to content

Commit cbf9f5f

Browse files
pcwaltonhuonw
authored andcommitted
libsyntax: De-@str get_single_str_from_tts
1 parent f9af11d commit cbf9f5f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libsyntax/ext/base.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,13 +439,15 @@ pub fn get_single_str_from_tts(cx: &ExtCtxt,
439439
sp: Span,
440440
tts: &[ast::TokenTree],
441441
name: &str)
442-
-> Option<@str> {
442+
-> Option<~str> {
443443
if tts.len() != 1 {
444444
cx.span_err(sp, format!("{} takes 1 argument.", name));
445445
} else {
446446
match tts[0] {
447447
ast::TTTok(_, token::LIT_STR(ident))
448-
| ast::TTTok(_, token::LIT_STR_RAW(ident, _)) => return Some(cx.str_of(ident)),
448+
| ast::TTTok(_, token::LIT_STR_RAW(ident, _)) => {
449+
return Some(cx.str_of(ident).to_str())
450+
}
449451
_ => cx.span_err(sp, format!("{} requires a string.", name)),
450452
}
451453
}

0 commit comments

Comments
 (0)