1 2 3 4 5 6 7 8 9 10
use syn::{Type, TypePath}; pub fn is_hashmap(ty: &Type) -> bool { if let Type::Path(TypePath { path, .. }) = ty && let Some(segment) = path.segments.last() { return segment.ident == "HashMap"; } false }