1 2 3 4 5 6 7 8 9 10 11 12
use syn::Path; /// Helper trait for holding idents. pub trait AttributeIdent { /// Holds the idents. const IDENTS: &'static [&'static str]; /// Check if path exists in the idents. fn is_ident(path: &Path) -> bool { Self::IDENTS.iter().any(|ident| path.is_ident(ident)) } }