diff options
Diffstat (limited to 'src/transform.rs')
-rw-r--r-- | src/transform.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/transform.rs b/src/transform.rs index fff9c6c..69929cc 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -9,7 +9,7 @@ use syn::{ use crate::{ filter_map_assoc_paths, match_assoc_type, - parse_assoc_type::DestType, + parse_assoc_type::{BoxType, DestType}, parse_trait_sig::{MethodParseError, TypeTransform}, syn_utils::{iter_path, iter_type}, }; @@ -56,8 +56,15 @@ impl AssocTypeConversions<'_> { { let inner = self.parse_type_path(&mut binding.ty)?; - *type_ = Type::Verbatim(quote! {Box<#elem + '_>}); - return Ok(TypeTransform::Iterator(inner.into())); + let box_type = BoxType { + inner: quote! {#elem}, + placeholder_lifetime: true, + }; + *type_ = Type::Verbatim(quote! {#box_type}); + return Ok(TypeTransform::Iterator( + box_type, + inner.into(), + )); } } } |