diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-25 12:54:51 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-25 12:54:51 +0100 |
commit | dc568083381d2073f0cfcfad8fa58158bd5bf811 (patch) | |
tree | 3c0655dd65c5912a4cbfd02bb4c9738e62074ccf /src/lib.rs | |
parent | 06a384000b0a6c7b657e4f8a9145b3d4357f3d70 (diff) |
refactor: remove unnecessary TypeOrPath type
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, } } |