diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-22 06:56:10 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-22 07:31:20 +0100 |
commit | a973a628ec051ab9483fde7d694bb261bb793178 (patch) | |
tree | 82c5f0e1411e379d0f23fe1180dff523c1c282f3 /src | |
parent | 7136160b97be8f87f79a4e3c819ab887cf8411aa (diff) |
fix unconvertible type error span
Diffstat (limited to 'src')
-rw-r--r-- | src/transform.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/transform.rs b/src/transform.rs index 69929cc..e8481bb 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -24,10 +24,9 @@ pub enum TransformError { impl AssocTypeConversions<'_> { pub fn parse_type_path(&self, type_: &mut Type) -> Result<TypeTransform, TransformError> { - let assoc_span = match iter_type(type_).filter_map(filter_map_assoc_paths).next() { - Some(path) => path.span(), - None => return Ok(TypeTransform::NoOp), - }; + if !iter_type(type_).any(match_assoc_type) { + return Ok(TypeTransform::NoOp); + } if let Type::Reference(TypeReference { lifetime: None, @@ -144,7 +143,7 @@ impl AssocTypeConversions<'_> { // the type contains an associated type but we // don't know how to deal with it so we abort - Err(TransformError::AssocTypeInUnsupportedType(assoc_span)) + Err(TransformError::AssocTypeInUnsupportedType(type_.span())) } } |