mokuya 0.0.7

Generic procedural macro helpers for parsing, type analysis, and derive macro generation.
Documentation
1
2
3
4
5
6
7
8
9
10
pub use syn::Type;

pub fn is_str_ref(ty: &Type) -> bool {
    if let Type::Reference(r) = ty
        && let Type::Path(tp) = &*r.elem
    {
        return tp.path.is_ident("str");
    }
    false
}