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
pub use syn::Type;

pub fn is_string(ty: &Type) -> bool {
    if let Type::Path(tp) = ty {
        tp.path.segments.len() == 1 && tp.path.segments[0].ident == "String"
    } else {
        false
    }
}