hebi_derive 0.3.1

Derive macros for Hebi
Documentation
1
2
3
4
5
6
7
8
9
10
use syn::Attribute;

pub fn is_attr(attr: &Attribute, tags: &[&str]) -> bool {
  if attr.path.leading_colon.is_none() && attr.path.segments.len() == 1 {
    let ident = &attr.path.segments.first().unwrap().ident;
    tags.iter().any(|&t| ident == t)
  } else {
    false
  }
}