From fcb78d65f2a3b553b9aaca762910daf10fbb1dce Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Mon, 27 Oct 2014 23:33:30 +1100 Subject: Convert some token functions into methods --- src/libsyntax/ext/format.rs | 3 +-- src/libsyntax/ext/trace_macros.rs | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index fdf61d4abd9..1b12ae67ee5 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -116,8 +116,7 @@ fn parse_args(ecx: &mut ExtCtxt, sp: Span, allow_method: bool, return (invocation, None); } if p.token == token::Eof { break } // accept trailing commas - if named || (token::is_ident(&p.token) && - p.look_ahead(1, |t| *t == token::Eq)) { + if named || (p.token.is_ident() && p.look_ahead(1, |t| *t == token::Eq)) { named = true; let ident = match p.token { token::Ident(i, _) => { diff --git a/src/libsyntax/ext/trace_macros.rs b/src/libsyntax/ext/trace_macros.rs index abf798ddacb..76f7b7b0d7b 100644 --- a/src/libsyntax/ext/trace_macros.rs +++ b/src/libsyntax/ext/trace_macros.rs @@ -12,7 +12,7 @@ use ast; use codemap::Span; use ext::base::ExtCtxt; use ext::base; -use parse::token::{keywords, is_keyword}; +use parse::token::keywords; pub fn expand_trace_macros(cx: &mut ExtCtxt, @@ -20,10 +20,10 @@ pub fn expand_trace_macros(cx: &mut ExtCtxt, tt: &[ast::TokenTree]) -> Box { match tt { - [ast::TtToken(_, ref tok)] if is_keyword(keywords::True, tok) => { + [ast::TtToken(_, ref tok)] if tok.is_keyword(keywords::True) => { cx.set_trace_macros(true); } - [ast::TtToken(_, ref tok)] if is_keyword(keywords::False, tok) => { + [ast::TtToken(_, ref tok)] if tok.is_keyword(keywords::False) => { cx.set_trace_macros(false); } _ => cx.span_err(sp, "trace_macros! accepts only `true` or `false`"), -- cgit 1.4.1-3-g733a5