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 }