diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-22 11:05:13 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-22 11:05:13 +0100 |
commit | 6b01f08fa1de6d67ab47ad19493ea683a75fc2ed (patch) | |
tree | 2edcd1e6cae887e7394dd95ea94666fbf62c0005 /src/transform.rs | |
parent | 8178b4671b03a9c7d4dbe6c4ce66b9cb737c4e2d (diff) |
rename MethodParseError to MethodError
Diffstat (limited to 'src/transform.rs')
-rw-r--r-- | src/transform.rs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/transform.rs b/src/transform.rs index f2744cf..cf18456 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -10,7 +10,7 @@ use syn::{ use crate::{ filter_map_assoc_paths, match_assoc_type, parse_assoc_type::{BoxType, DestType}, - parse_trait_sig::{MethodParseError, TypeTransform}, + parse_trait_sig::{MethodError, TypeTransform}, syn_utils::{iter_path, iter_type}, }; @@ -161,7 +161,7 @@ impl TypeConverter<'_> { pub fn dynamize_function_bounds( generics: &mut Generics, type_converter: &TypeConverter, -) -> Result<HashMap<Ident, Vec<TypeTransform>>, (Span, MethodParseError)> { +) -> Result<HashMap<Ident, Vec<TypeTransform>>, (Span, MethodError)> { let mut type_param_transforms = HashMap::new(); for type_param in generics.type_params_mut() { @@ -202,7 +202,7 @@ pub fn dynamize_function_bounds( { return Err(( assoc_type.span(), - MethodParseError::UnconvertibleAssocTypeInWhereClause, + MethodError::UnconvertibleAssocTypeInWhereClause, )); } @@ -214,7 +214,7 @@ pub fn dynamize_function_bounds( { return Err(( assoc_type.span(), - MethodParseError::UnconvertibleAssocTypeInWhereClause, + MethodError::UnconvertibleAssocTypeInWhereClause, )); } } @@ -231,7 +231,7 @@ fn dynamize_trait_bound( type_converter: &TypeConverter, type_ident: &Ident, type_param_transforms: &mut HashMap<Ident, Vec<TypeTransform>>, -) -> Result<(), (Span, MethodParseError)> { +) -> Result<(), (Span, MethodError)> { if bound.path.segments.len() == 1 { let segment = &mut bound.path.segments[0]; @@ -244,10 +244,10 @@ fn dynamize_trait_bound( transforms.push(ret_type); } Err(TransformError::UnconvertibleAssocType(span)) => { - return Err((span, MethodParseError::UnconvertibleAssocType)); + return Err((span, MethodError::UnconvertibleAssocType)); } Err(TransformError::AssocTypeInUnsupportedType(span)) => { - return Err((span, MethodParseError::UnconvertibleAssocTypeInFnInput)); + return Err((span, MethodError::UnconvertibleAssocTypeInFnInput)); } } } @@ -261,10 +261,7 @@ fn dynamize_trait_bound( .filter_map(filter_map_assoc_paths) .next() { - return Err(( - path.span(), - MethodParseError::UnconvertibleAssocTypeInTraitBound, - )); + return Err((path.span(), MethodError::UnconvertibleAssocTypeInTraitBound)); } Ok(()) } |