diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-05-11 17:41:37 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-05-22 19:48:56 +0300 |
| commit | 59a382122fb09e2a9b4629e36efbc63a321eab6a (patch) | |
| tree | 4ebc598c88ba0ca2a11848b1cd2e142cd340ed15 /src/libsyntax/attr | |
| parent | 37ff5d388f8c004ca248adb635f1cc84d347eda0 (diff) | |
| download | rust-59a382122fb09e2a9b4629e36efbc63a321eab6a.tar.gz rust-59a382122fb09e2a9b4629e36efbc63a321eab6a.zip | |
Simplify use of keyword symbols
Diffstat (limited to 'src/libsyntax/attr')
| -rw-r--r-- | src/libsyntax/attr/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs index 592b40df176..3e93ac23a53 100644 --- a/src/libsyntax/attr/mod.rs +++ b/src/libsyntax/attr/mod.rs @@ -22,7 +22,7 @@ use crate::parse::parser::Parser; use crate::parse::{self, ParseSess, PResult}; use crate::parse::token::{self, Token}; use crate::ptr::P; -use crate::symbol::{keywords, Symbol, sym}; +use crate::symbol::{kw, sym, Symbol}; use crate::ThinVec; use crate::tokenstream::{TokenStream, TokenTree, DelimSpan}; use crate::GLOBALS; @@ -90,7 +90,7 @@ impl NestedMetaItem { self.meta_item().and_then(|meta_item| meta_item.ident()) } pub fn name_or_empty(&self) -> Symbol { - self.ident().unwrap_or(keywords::Invalid.ident()).name + self.ident().unwrap_or(Ident::invalid()).name } /// Gets the string value if self is a MetaItem and the MetaItem is a @@ -168,7 +168,7 @@ impl Attribute { } } pub fn name_or_empty(&self) -> Symbol { - self.ident().unwrap_or(keywords::Invalid.ident()).name + self.ident().unwrap_or(Ident::invalid()).name } pub fn value_str(&self) -> Option<Symbol> { @@ -206,7 +206,7 @@ impl MetaItem { } } pub fn name_or_empty(&self) -> Symbol { - self.ident().unwrap_or(keywords::Invalid.ident()).name + self.ident().unwrap_or(Ident.invalid()).name } // #[attribute(name = "value")] |
