Skip to content

Commit

Permalink
Merge pull request #212 from UnexDev/master
Browse files Browse the repository at this point in the history
Add generics to function_no_cache
  • Loading branch information
jaemk committed Jul 3, 2024
2 parents 1399679 + ce972ae commit d543b69
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cached_proc_macro/src/cached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub fn cached(args: TokenStream, input: TokenStream) -> TokenStream {
let inputs = signature.inputs.clone();
let output = signature.output.clone();
let asyncness = signature.asyncness;
let generics = signature.generics.clone();

let input_tys = get_input_types(&inputs);
let input_names = get_input_names(&inputs);
Expand Down Expand Up @@ -210,7 +211,7 @@ pub fn cached(args: TokenStream, input: TokenStream) -> TokenStream {
};

function_no_cache = quote! {
async fn #no_cache_fn_ident(#inputs) #output #body
async fn #no_cache_fn_ident #generics (#inputs) #output #body
};

function_call = quote! {
Expand All @@ -226,7 +227,7 @@ pub fn cached(args: TokenStream, input: TokenStream) -> TokenStream {
};

function_no_cache = quote! {
fn #no_cache_fn_ident(#inputs) #output #body
fn #no_cache_fn_ident #generics (#inputs) #output #body
};

function_call = quote! {
Expand Down

0 comments on commit d543b69

Please sign in to comment.