From 36c8f6b0d3f38904459f40496af36d36e9cc0fac Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Thu, 17 Nov 2016 14:04:20 +0000 Subject: Cleanup `InternedString`. --- src/libsyntax/ext/base.rs | 2 +- src/libsyntax/ext/tt/macro_rules.rs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 1dda5e3ba06..ddf4cf11f20 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -643,7 +643,7 @@ impl<'a> ExtCtxt<'a> { loop { if self.codemap().with_expn_info(expn_id, |info| { info.map_or(None, |i| { - if i.callee.name().as_str() == "include" { + if i.callee.name() == "include" { // Stop going up the backtrace once include! is encountered return None; } diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 4c37a0a71e2..59b8b50e88c 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -791,8 +791,7 @@ fn is_in_follow(tok: &Token, frag: &str) -> Result "pat" => { match *tok { FatArrow | Comma | Eq | BinOp(token::Or) => Ok(true), - Ident(i) if (i.name.as_str() == "if" || - i.name.as_str() == "in") => Ok(true), + Ident(i) if i.name == "if" || i.name == "in" => Ok(true), _ => Ok(false) } }, @@ -800,8 +799,8 @@ fn is_in_follow(tok: &Token, frag: &str) -> Result match *tok { OpenDelim(token::DelimToken::Brace) | OpenDelim(token::DelimToken::Bracket) | Comma | FatArrow | Colon | Eq | Gt | Semi | BinOp(token::Or) => Ok(true), - MatchNt(_, ref frag) if frag.name.as_str() == "block" => Ok(true), - Ident(i) if i.name.as_str() == "as" || i.name.as_str() == "where" => Ok(true), + MatchNt(_, ref frag) if frag.name == "block" => Ok(true), + Ident(i) if i.name == "as" || i.name == "where" => Ok(true), _ => Ok(false) } }, -- cgit 1.4.1-3-g733a5