about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-01-15 18:33:33 -0800
committerHuon Wilson <dbau.pp+github@gmail.com>2014-02-02 01:44:48 +1100
commitcbf9f5f5dfd5e3ec36899adf89c55a20380da63e (patch)
tree98292448425ba17f285c3c350df034de3190405f /src
parentf9af11d6cc0266a5690897b4645d8cab2ed1115b (diff)
downloadrust-cbf9f5f5dfd5e3ec36899adf89c55a20380da63e.tar.gz
rust-cbf9f5f5dfd5e3ec36899adf89c55a20380da63e.zip
libsyntax: De-`@str` `get_single_str_from_tts`
Diffstat (limited to 'src')
-rw-r--r--src/libsyntax/ext/base.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index eda0a47148a..74a9dbdd7c9 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -439,13 +439,15 @@ pub fn get_single_str_from_tts(cx: &ExtCtxt,
                                sp: Span,
                                tts: &[ast::TokenTree],
                                name: &str)
-                               -> Option<@str> {
+                               -> Option<~str> {
     if tts.len() != 1 {
         cx.span_err(sp, format!("{} takes 1 argument.", name));
     } else {
         match tts[0] {
             ast::TTTok(_, token::LIT_STR(ident))
-                | ast::TTTok(_, token::LIT_STR_RAW(ident, _)) => return Some(cx.str_of(ident)),
+            | ast::TTTok(_, token::LIT_STR_RAW(ident, _)) => {
+                return Some(cx.str_of(ident).to_str())
+            }
             _ => cx.span_err(sp, format!("{} requires a string.", name)),
         }
     }