commit | 02d77ccad48c1130a178c417e6a4d0f9c593516a | [log] [tgz] |
---|---|---|
author | David Tolnay <dtolnay@gmail.com> | Sun Oct 02 09:52:08 2016 -0700 |
committer | David Tolnay <dtolnay@gmail.com> | Sun Oct 02 09:52:08 2016 -0700 |
tree | 585b97782e5a1ff5fe3ceee5fe4861387b231654 | |
parent | f9505b527a7c24442349f469ad33e3652c3bd7c2 [diff] |
Add Attribute::name
diff --git a/src/attr.rs b/src/attr.rs index 8a16982..f953e6d 100644 --- a/src/attr.rs +++ b/src/attr.rs
@@ -7,6 +7,12 @@ pub is_sugared_doc: bool, } +impl Attribute { + pub fn name(&self) -> &str { + self.value.name() + } +} + /// A compile-time attribute item. /// /// E.g. `#[test]`, `#[derive(..)]` or `#[feature = "foo"]`