@@ -94,10 +94,16 @@ pub trait AttrMetaMethods {
9494
9595 /// Indicates if the attribute is a Word.
9696 fn is_word ( & self ) -> bool ;
97+
9798 /// Indicates if the attribute is a Value String.
98- fn is_value_str ( & self ) -> bool ;
99+ fn is_value_str ( & self ) -> bool {
100+ self . value_str ( ) . is_some ( )
101+ }
102+
99103 /// Indicates if the attribute is a Meta-Item List.
100- fn is_meta_item_list ( & self ) -> bool ;
104+ fn is_meta_item_list ( & self ) -> bool {
105+ self . meta_item_list ( ) . is_some ( )
106+ }
101107
102108 fn span ( & self ) -> Span ;
103109}
@@ -119,9 +125,6 @@ impl AttrMetaMethods for Attribute {
119125 }
120126
121127 fn is_word ( & self ) -> bool { self . meta ( ) . is_word ( ) }
122- fn is_value_str ( & self ) -> bool { self . meta ( ) . is_value_str ( ) }
123-
124- fn is_meta_item_list ( & self ) -> bool { self . meta ( ) . is_meta_item_list ( ) }
125128
126129 fn span ( & self ) -> Span { self . meta ( ) . span }
127130}
@@ -161,10 +164,6 @@ impl AttrMetaMethods for MetaItem {
161164 }
162165 }
163166
164- fn is_value_str ( & self ) -> bool { self . value_str ( ) . is_some ( ) }
165-
166- fn is_meta_item_list ( & self ) -> bool { self . meta_item_list ( ) . is_some ( ) }
167-
168167 fn span ( & self ) -> Span { self . span }
169168}
170169
@@ -240,7 +239,7 @@ pub fn mk_word_item(name: InternedString) -> P<MetaItem> {
240239
241240pub fn mk_spanned_name_value_item ( sp : Span , name : InternedString , value : ast:: Lit )
242241 -> P < MetaItem > {
243- P ( respan ( sp, MetaItemKind :: NameValue ( name, value) ) )
242+ P ( respan ( sp, MetaItemKind :: NameValue ( name, value) ) )
244243}
245244
246245pub 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
249248}
250249
251250pub fn mk_spanned_word_item ( sp : Span , name : InternedString ) -> P < MetaItem > {
252- P ( respan ( sp, MetaItemKind :: Word ( name) ) )
251+ P ( respan ( sp, MetaItemKind :: Word ( name) ) )
253252}
254253
255254
0 commit comments