diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-22 11:42:07 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-22 11:42:07 +0100 |
commit | 7384c11750e9971770683861f7cd5f719c487ce9 (patch) | |
tree | 91bceba6b77ff84b04363a6976284df3023e8e9d /src/transform.rs | |
parent | 5c6f0d3510517d867c27e9a658e5015fb9b3d5ef (diff) |
refactor: make MethodError wrap TransformError
Diffstat (limited to 'src/transform.rs')
-rw-r--r-- | src/transform.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/transform.rs b/src/transform.rs index 13cf519..4649037 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -19,6 +19,7 @@ pub struct TypeConverter<'a> { pub assoc_type_conversions: HashMap<Ident, DestType<'a>>, } +#[derive(Debug)] pub enum TransformError { AssocTypeWithoutDestType, UnsupportedType, @@ -237,11 +238,8 @@ fn dynamize_trait_bound( Ok(ret_type) => { transforms.push(ret_type); } - Err((span, TransformError::AssocTypeWithoutDestType)) => { - return Err((span, MethodError::AssocTypeWithoutDestType)); - } - Err((span, TransformError::UnsupportedType)) => { - return Err((span, MethodError::UnsupportedType)); + Err((span, err)) => { + return Err((span, err.into())); } } } |