aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 8a030c4..94fbcf3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -45,11 +45,11 @@ fn generate_type_aliases(
45 fn_return_type: Box<Type>, 45 fn_return_type: Box<Type>,
46 fn_name: &syn::Ident, 46 fn_name: &syn::Ident,
47) -> Vec<proc_macro2::TokenStream> { 47) -> Vec<proc_macro2::TokenStream> {
48 let type_t0 = format_ident!("_{}_T0", fn_name); 48 let type_t0 = format_ident!("_T0{}", fn_name);
49 let mut type_aliases = vec![quote! { type #type_t0 = #fn_return_type }]; 49 let mut type_aliases = vec![quote! { type #type_t0 = #fn_return_type }];
50 for (i, t) in (1..).zip(fn_arg_types.into_iter().rev()) { 50 for (i, t) in (1..).zip(fn_arg_types.into_iter().rev()) {
51 let p = format_ident!("_{}_{}", fn_name, format!("T{}", i - 1)); 51 let p = format_ident!("_{}{}", format!("T{}", i - 1), fn_name);
52 let n = format_ident!("_{}_{}", fn_name, format!("T{}", i)); 52 let n = format_ident!("_{}{}", format!("T{}", i), fn_name);
53 type_aliases.push(quote! { 53 type_aliases.push(quote! {
54 type #n = impl Fn(#t) -> #p 54 type #n = impl Fn(#t) -> #p
55 }) 55 })
@@ -83,7 +83,7 @@ fn generate_curry(parsed: ItemFn) -> proc_macro2::TokenStream {
83 &fn_name, 83 &fn_name,
84 ); 84 );
85 85
86 let return_type = format_ident!("_{}_{}", &fn_name, format!("T{}", type_aliases.len() - 1)); 86 let return_type = format_ident!("_{}{}", format!("T{}", type_aliases.len() - 1), &fn_name);
87 87
88 let gen = quote! { 88 let gen = quote! {
89 #(#type_aliases);* ; 89 #(#type_aliases);* ;