Inline Attribute::has_name

This commit is contained in:
Tomasz Miąsko
2021-03-11 00:00:00 +00:00
parent 5c6d3bf389
commit 1ba71abddd
+1
View File
@@ -120,6 +120,7 @@ pub fn name_value_literal_span(&self) -> Option<Span> {
}
impl Attribute {
#[inline]
pub fn has_name(&self, name: Symbol) -> bool {
match self.kind {
AttrKind::Normal(ref item, _) => item.path == name,