diff options
Diffstat (limited to 'src/transform.rs')
-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())) } } |