@@ -12,7 +12,7 @@ use syntax::codemap::Span;
12
12
use syntax:: ast:: { TokenTree , TtToken } ;
13
13
use syntax:: ast;
14
14
use syntax:: ext:: base:: { ExtCtxt , MacResult , MacExpr } ;
15
- use syntax:: parse:: token:: { get_ident, InternedString , LitStr , Ident } ;
15
+ use syntax:: parse:: token:: { get_ident, InternedString , Ident , Literal , Lit } ;
16
16
17
17
use std:: iter:: Chain ;
18
18
use std:: slice:: { Items , Found , NotFound } ;
@@ -37,7 +37,7 @@ pub fn expand_static_atom_set(cx: &mut ExtCtxt, sp: Span, tt: &[TokenTree]) -> B
37
37
fn atom_tok_to_str ( t : & TokenTree ) -> Option < InternedString > {
38
38
Some ( get_ident ( match * t {
39
39
TtToken ( _, Ident ( s, _) ) => s,
40
- TtToken ( _, LitStr ( s ) ) => s. ident ( ) ,
40
+ TtToken ( _, Literal ( Lit :: Str_ ( s ) , _ ) ) => s. ident ( ) ,
41
41
_ => return None ,
42
42
} ) )
43
43
}
@@ -91,7 +91,7 @@ pub fn expand_atom(cx: &mut ExtCtxt, sp: Span, tt: &[TokenTree]) -> Box<MacResul
91
91
_ => bail ! ( cx, sp, usage) ,
92
92
} ;
93
93
box expect ! ( cx, sp, make_atom_result( cx, name. get( ) ) ,
94
- format!( "Unknown static atom {:s }" , name. get( ) ) . as_slice( ) )
94
+ format!( "Unknown static atom {}" , name. get( ) ) . as_slice( ) )
95
95
}
96
96
97
97
// Translate `ns!(HTML)` into `Namespace { atom: atom!("http://www.w3.org/1999/xhtml") }`.
@@ -111,7 +111,7 @@ pub fn expand_ns(cx: &mut ExtCtxt, sp: Span, tt: &[TokenTree]) -> Box<MacResult+
111
111
let ns_names: Vec < & ' static str > = ALL_NS . slice_from ( 1 ) . iter ( )
112
112
. map ( |& ( x, _) | x) . collect ( ) ;
113
113
format ! ( "Usage: ns!(HTML), case-insensitive. \
114
- Known namespaces: {:s }",
114
+ Known namespaces: {}",
115
115
ns_names. connect( " " ) )
116
116
}
117
117
@@ -126,7 +126,7 @@ pub fn expand_ns(cx: &mut ExtCtxt, sp: Span, tt: &[TokenTree]) -> Box<MacResult+
126
126
127
127
// All of the URLs should be in the static atom table.
128
128
let AtomResult { expr, pat } = expect ! ( cx, sp, make_atom_result( cx, url) ,
129
- format!( "internal plugin error: can't find namespace url {:s }" , url) . as_slice( ) ) ;
129
+ format!( "internal plugin error: can't find namespace url {}" , url) . as_slice( ) ) ;
130
130
131
131
box AtomResult {
132
132
expr : quote_expr ! ( & mut * cx, :: string_cache:: namespace:: Namespace ( $expr) ) ,
0 commit comments