Skip to content

Commit a227ba9

Browse files
committed
Merge pull request servo#48 from cgaebel/rustup
rustup (and rust-phf-up)
2 parents 40a45f9 + 75521e6 commit a227ba9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

macros/src/atom/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use syntax::codemap::Span;
1212
use syntax::ast::{TokenTree, TtToken};
1313
use syntax::ast;
1414
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};
1616

1717
use std::iter::Chain;
1818
use std::slice::{Items, Found, NotFound};
@@ -37,7 +37,7 @@ pub fn expand_static_atom_set(cx: &mut ExtCtxt, sp: Span, tt: &[TokenTree]) -> B
3737
fn atom_tok_to_str(t: &TokenTree) -> Option<InternedString> {
3838
Some(get_ident(match *t {
3939
TtToken(_, Ident(s, _)) => s,
40-
TtToken(_, LitStr(s)) => s.ident(),
40+
TtToken(_, Literal(Lit::Str_(s), _)) => s.ident(),
4141
_ => return None,
4242
}))
4343
}
@@ -91,7 +91,7 @@ pub fn expand_atom(cx: &mut ExtCtxt, sp: Span, tt: &[TokenTree]) -> Box<MacResul
9191
_ => bail!(cx, sp, usage),
9292
};
9393
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())
9595
}
9696

9797
// 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+
111111
let ns_names: Vec<&'static str> = ALL_NS.slice_from(1).iter()
112112
.map(|&(x, _)| x).collect();
113113
format!("Usage: ns!(HTML), case-insensitive. \
114-
Known namespaces: {:s}",
114+
Known namespaces: {}",
115115
ns_names.connect(" "))
116116
}
117117

@@ -126,7 +126,7 @@ pub fn expand_ns(cx: &mut ExtCtxt, sp: Span, tt: &[TokenTree]) -> Box<MacResult+
126126

127127
// All of the URLs should be in the static atom table.
128128
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());
130130

131131
box AtomResult {
132132
expr: quote_expr!(&mut *cx, ::string_cache::namespace::Namespace($expr)),

src/atom/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl Atom {
175175
}
176176

177177
pub fn from_slice(string_to_add: &str) -> Atom {
178-
let unpacked = match static_atom_set.get_index_equiv(string_to_add) {
178+
let unpacked = match static_atom_set.get_index(string_to_add) {
179179
Some(id) => Static(id as u32),
180180
None => {
181181
let len = string_to_add.len();
@@ -265,7 +265,7 @@ impl fmt::Show for Atom {
265265
}
266266
};
267267

268-
write!(f, "Atom('{:s}' type={:s})", self.as_slice(), ty_str)
268+
write!(f, "Atom('{}' type={})", self.as_slice(), ty_str)
269269
}
270270
}
271271

0 commit comments

Comments
 (0)