Remove MetaItemKind::value_str
.
`MetaItem::value_str` is good enough. And this makes `MetaItem::value_str` more like `MetaItem::meta_item_list` and `name_value_literal`.
This commit is contained in:
parent
15e71b6e43
commit
d5ec9b458a
1 changed files with 4 additions and 8 deletions
|
@ -298,7 +298,10 @@ impl MetaItem {
|
|||
}
|
||||
|
||||
pub fn value_str(&self) -> Option<Symbol> {
|
||||
self.kind.value_str()
|
||||
match &self.kind {
|
||||
MetaItemKind::NameValue(v) => v.kind.str(),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn from_tokens<'a, I>(tokens: &mut iter::Peekable<I>) -> Option<MetaItem>
|
||||
|
@ -362,13 +365,6 @@ impl MetaItem {
|
|||
}
|
||||
|
||||
impl MetaItemKind {
|
||||
pub fn value_str(&self) -> Option<Symbol> {
|
||||
match self {
|
||||
MetaItemKind::NameValue(v) => v.kind.str(),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn list_from_tokens(tokens: TokenStream) -> Option<ThinVec<NestedMetaItem>> {
|
||||
let mut tokens = tokens.trees().peekable();
|
||||
let mut result = ThinVec::new();
|
||||
|
|
Loading…
Add table
Reference in a new issue