syn_ext/
ident.rs

1
2
3
4
5
6
7
8
9
use syn::Ident;

/// Shortcut to get [syn::Ident](struct@syn::Ident) from various types
pub trait GetIdent {
    /// Returns reference of ident if its [syn::Path] is [syn::Ident](struct@syn::Ident); Otherwise None
    ///
    /// Any [crate::ext::GetPath] also implements `GetIdent`.
    fn get_ident(&self) -> Option<&Ident>;
}