mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Avoid code duplication in {MetaItem,MetaItemKind}::value_str
.
The two methods are almost identical.
This commit is contained in:
parent
40336865fe
commit
7d1e5a485c
@ -182,13 +182,7 @@ impl MetaItem {
|
||||
}
|
||||
|
||||
pub fn value_str(&self) -> Option<Symbol> {
|
||||
match self.kind {
|
||||
MetaItemKind::NameValue(ref v) => match v.kind {
|
||||
LitKind::Str(ref s, _) => Some(*s),
|
||||
_ => None,
|
||||
},
|
||||
_ => None,
|
||||
}
|
||||
self.kind.value_str()
|
||||
}
|
||||
|
||||
pub fn meta_item_list(&self) -> Option<&[NestedMetaItem]> {
|
||||
|
Loading…
Reference in New Issue
Block a user