mokuya 0.0.5

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

pub fn is_async_fn(ty: &Type) -> bool {
    if let Type::Path(type_path) = ty {
        type_path
            .path
            .segments
            .iter()
            .any(|segment| segment.ident == "Future")
    } else {
        false
    }
}