Simplify use of keyword symbols
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use syntax::ext::base::{self, ExtCtxt};
|
||||
use syntax::feature_gate;
|
||||
use syntax::symbol::{keywords, sym};
|
||||
use syntax::symbol::{kw, sym};
|
||||
use syntax_pos::Span;
|
||||
use syntax::tokenstream::TokenTree;
|
||||
|
||||
@@ -17,10 +17,10 @@ pub fn expand_trace_macros(cx: &mut ExtCtxt<'_>,
|
||||
}
|
||||
|
||||
match (tt.len(), tt.first()) {
|
||||
(1, Some(&TokenTree::Token(_, ref tok))) if tok.is_keyword(keywords::True) => {
|
||||
(1, Some(&TokenTree::Token(_, ref tok))) if tok.is_keyword(kw::True) => {
|
||||
cx.set_trace_macros(true);
|
||||
}
|
||||
(1, Some(&TokenTree::Token(_, ref tok))) if tok.is_keyword(keywords::False) => {
|
||||
(1, Some(&TokenTree::Token(_, ref tok))) if tok.is_keyword(kw::False) => {
|
||||
cx.set_trace_macros(false);
|
||||
}
|
||||
_ => cx.span_err(sp, "trace_macros! accepts only `true` or `false`"),
|
||||
|
||||
Reference in New Issue
Block a user