about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/attr
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-08-17 12:32:49 +0200
committerGitHub <noreply@github.com>2022-08-17 12:32:49 +0200
commitd5dca26a94437d9b2c2d37cd515f2ac32c30919b (patch)
tree4145261e4bd8e70cd79e7422f507c5684ee42eb4 /compiler/rustc_ast/src/attr
parentbb77336c0a6708bdebcbf3a1df19b258919b582e (diff)
parent5d3cc1713a8816e3b4f10dc2cbaf910b16dc8763 (diff)
downloadrust-d5dca26a94437d9b2c2d37cd515f2ac32c30919b.tar.gz
rust-d5dca26a94437d9b2c2d37cd515f2ac32c30919b.zip
Rollup merge of #100018 - nnethercote:clean-up-LitKind, r=petrochenkov
Clean up `LitKind`

r? ``@petrochenkov``
Diffstat (limited to 'compiler/rustc_ast/src/attr')
-rw-r--r--compiler/rustc_ast/src/attr/mod.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs
index bc4f183d9b1..0d114f1366c 100644
--- a/compiler/rustc_ast/src/attr/mod.rs
+++ b/compiler/rustc_ast/src/attr/mod.rs
@@ -184,13 +184,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]> {