aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorValentin Brandl <[email protected]>2020-05-12 14:07:06 +0100
committerGitHub <[email protected]>2020-05-12 14:07:06 +0100
commit33c3084d173301f271ba819d9de360608924e683 (patch)
treec8c53a8019e1ed0d8cc75b39cbfb2ddb74b3d562 /src
parentddee8de73f8d95710d580cd1267e2f52709c5b2e (diff)
Change type names to prevent compiler warnings (#1)HEADmaster
Diffstat (limited to 'src')
-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);* ;