We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
MetaItemKind::value_str
1 parent 15e71b6 commit d5ec9b4Copy full SHA for d5ec9b4
compiler/rustc_ast/src/attr/mod.rs
@@ -298,7 +298,10 @@ impl MetaItem {
298
}
299
300
pub fn value_str(&self) -> Option<Symbol> {
301
- self.kind.value_str()
+ match &self.kind {
302
+ MetaItemKind::NameValue(v) => v.kind.str(),
303
+ _ => None,
304
+ }
305
306
307
fn from_tokens<'a, I>(tokens: &mut iter::Peekable<I>) -> Option<MetaItem>
@@ -362,13 +365,6 @@ impl MetaItem {
362
365
363
366
364
367
impl MetaItemKind {
- pub fn value_str(&self) -> Option<Symbol> {
- match self {
- MetaItemKind::NameValue(v) => v.kind.str(),
368
- _ => None,
369
- }
370
371
-
372
fn list_from_tokens(tokens: TokenStream) -> Option<ThinVec<NestedMetaItem>> {
373
let mut tokens = tokens.trees().peekable();
374
let mut result = ThinVec::new();
0 commit comments