diff options
| author | cgswords <cameronswords@gmail.com> | 2016-07-17 21:45:06 -0700 |
|---|---|---|
| committer | cgswords <cameronswords@gmail.com> | 2016-07-25 14:27:10 -0700 |
| commit | 5553901146fa80c652abdc514b38360a0ae7418d (patch) | |
| tree | 722ec8d11d396c7a65fd3617d3a3c0d47ed8f234 /src/libsyntax | |
| parent | a5e5ea1646367b82864af3a2a508993d76b792af (diff) | |
| download | rust-5553901146fa80c652abdc514b38360a0ae7418d.tar.gz rust-5553901146fa80c652abdc514b38360a0ae7418d.zip | |
Adressed PR comments.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/attr.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 8bd3f5195cc..b622f6861b3 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -94,10 +94,16 @@ pub trait AttrMetaMethods { /// Indicates if the attribute is a Word. fn is_word(&self) -> bool; + /// Indicates if the attribute is a Value String. - fn is_value_str(&self) -> bool; + fn is_value_str(&self) -> bool { + self.value_str().is_some() + } + /// Indicates if the attribute is a Meta-Item List. - fn is_meta_item_list(&self) -> bool; + fn is_meta_item_list(&self) -> bool { + self.meta_item_list().is_some() + } fn span(&self) -> Span; } @@ -119,9 +125,6 @@ impl AttrMetaMethods for Attribute { } fn is_word(&self) -> bool { self.meta().is_word() } - fn is_value_str(&self) -> bool { self.meta().is_value_str() } - - fn is_meta_item_list(&self) -> bool { self.meta().is_meta_item_list() } fn span(&self) -> Span { self.meta().span } } @@ -161,10 +164,6 @@ impl AttrMetaMethods for MetaItem { } } - fn is_value_str(&self) -> bool { self.value_str().is_some() } - - fn is_meta_item_list(&self) -> bool { self.meta_item_list().is_some() } - fn span(&self) -> Span { self.span } } @@ -240,7 +239,7 @@ pub fn mk_word_item(name: InternedString) -> P<MetaItem> { pub fn mk_spanned_name_value_item(sp: Span, name: InternedString, value: ast::Lit) -> P<MetaItem> { - P(respan(sp,MetaItemKind::NameValue(name, value))) + P(respan(sp, MetaItemKind::NameValue(name, value))) } pub fn mk_spanned_list_item(sp: Span, name: InternedString, items: Vec<P<MetaItem>>) @@ -249,7 +248,7 @@ pub fn mk_spanned_list_item(sp: Span, name: InternedString, items: Vec<P<MetaIte } pub fn mk_spanned_word_item(sp: Span, name: InternedString) -> P<MetaItem> { - P(respan(sp,MetaItemKind::Word(name))) + P(respan(sp, MetaItemKind::Word(name))) } |
