diff options
Diffstat (limited to 'src/transform.rs')
-rw-r--r-- | src/transform.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/transform.rs b/src/transform.rs index 4fc22f5..ec2f3a6 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -12,7 +12,7 @@ use crate::{ }; #[derive(Default)] -pub struct AssocTypeConversions<'a>(pub HashMap<&'a Ident, &'a Type>); +pub struct AssocTypeConversions<'a>(pub HashMap<Ident, &'a Type>); pub enum TransformError { UnconvertibleAssocType(Span), @@ -36,7 +36,7 @@ impl AssocTypeConversions<'_> { let ident = &path.segments.last().unwrap().ident; *type_ = (*self .0 - .get(&ident) + .get(ident) .ok_or_else(|| TransformError::UnconvertibleAssocType(ident.span()))?) .clone(); return Ok(TypeTransform::Into); @@ -100,10 +100,10 @@ impl AssocTypeConversions<'_> { } } -pub fn dynamize_function_bounds<'a>( - generics: &'a mut Generics, - assoc_type_conversions: &AssocTypeConversions<'a>, -) -> Result<HashMap<&'a Ident, Vec<TypeTransform>>, (Span, MethodParseError)> { +pub fn dynamize_function_bounds( + generics: &mut Generics, + assoc_type_conversions: &AssocTypeConversions, +) -> Result<HashMap<Ident, Vec<TypeTransform>>, (Span, MethodParseError)> { let mut type_param_transforms = HashMap::new(); for generic_param in &mut generics.params { @@ -139,7 +139,8 @@ pub fn dynamize_function_bounds<'a>( } } if transforms.iter().any(|t| !matches!(t, TypeTransform::NoOp)) { - type_param_transforms.insert(&type_param.ident, transforms); + type_param_transforms + .insert(type_param.ident.clone(), transforms); } } } |