diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,9 +1,7 @@ #![doc = include_str!("../README.md")] -use std::collections::HashMap; use proc_macro::TokenStream; use proc_macro2::Group; -use proc_macro2::Ident; use quote::format_ident; use quote::quote; use quote::quote_spanned; @@ -42,9 +40,12 @@ use crate::parse_trait_sig::parse_trait_signature; use crate::parse_trait_sig::MethodParseError; use crate::parse_trait_sig::SignatureChanges; use crate::parse_trait_sig::TypeTransform; +use crate::transform::AssocTypeConversions; + mod parse_assoc_type; mod parse_trait_sig; mod syn_utils; +mod transform; macro_rules! abort { ($span:expr, $message:literal) => { @@ -61,7 +62,7 @@ pub fn dynamize(_attr: TokenStream, input: TokenStream) -> TokenStream { let mut objectifiable_methods: Vec<(Signature, SignatureChanges)> = Vec::new(); - let mut assoc_type_conversions: HashMap<&Ident, &Type> = HashMap::new(); + let mut assoc_type_conversions = AssocTypeConversions::default(); for item in &original_trait.items { if let TraitItem::Type(assoc_type) = item { @@ -77,7 +78,7 @@ pub fn dynamize(_attr: TokenStream, input: TokenStream) -> TokenStream { ) } Ok((ident, type_)) => { - assoc_type_conversions.insert(ident, type_); + assoc_type_conversions.0.insert(ident, type_); } } } |