aboutsummaryrefslogtreecommitdiff
path: root/src/transform.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/transform.rs')
-rw-r--r--src/transform.rs19
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(())
}