diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -33,7 +33,6 @@ use syn::TypeParam; use syn::TypeParamBound; use syn::TypePath; use syn::Visibility; -use syn_utils::TypeOrPath; use crate::parse_assoc_type::parse_assoc_type; use crate::parse_assoc_type::AssocTypeError; @@ -373,20 +372,20 @@ fn generate_blanket_impl( } } -fn path_is_assoc_type(path: &Path) -> bool { - path.segments[0].ident == "Self" +fn path_is_assoc_type(path: &TypePath) -> bool { + path.path.segments[0].ident == "Self" } -fn match_assoc_type(item: TypeOrPath) -> bool { - if let TypeOrPath::Path(path) = item { +fn match_assoc_type(item: &Type) -> bool { + if let Type::Path(path) = item { return path_is_assoc_type(path); } false } -fn filter_map_assoc_paths(item: TypeOrPath) -> Option<&Path> { +fn filter_map_assoc_paths(item: &Type) -> Option<&TypePath> { match item { - TypeOrPath::Path(p) if path_is_assoc_type(p) => Some(p), + Type::Path(p) if path_is_assoc_type(p) => Some(p), _other => None, } } |