Skip to content

Commit

Permalink
Pass the function's visibilty to the generated function
Browse files Browse the repository at this point in the history
Closes #80
  • Loading branch information
bl-ue committed Dec 7, 2022
1 parent 4c937af commit 60eee70
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions serial_test_derive/src/lib.rs
Expand Up @@ -377,6 +377,7 @@ where
if asyncness.is_some() && cfg!(not(feature = "async")) {
panic!("async testing attempted with async feature disabled in serial_test!");
}
let vis = ast.vis;
let name = ast.sig.ident;
let return_type = match ast.sig.output {
syn::ReturnType::Default => None,
Expand Down Expand Up @@ -414,7 +415,7 @@ where
quote! {
#(#attrs)
*
async fn #name () -> #ret {
#vis async fn #name () -> #ret {
serial_test::#fnname(#(#args ),*, || async #block ).await;
}
}
Expand All @@ -424,7 +425,7 @@ where
quote! {
#(#attrs)
*
fn #name () -> #ret {
#vis fn #name () -> #ret {
serial_test::#fnname(#(#args ),*, || #block )
}
}
Expand All @@ -437,7 +438,7 @@ where
quote! {
#(#attrs)
*
async fn #name () {
#vis async fn #name () {
serial_test::#fnname(#(#args ),*, || async #block ).await;
}
}
Expand All @@ -447,7 +448,7 @@ where
quote! {
#(#attrs)
*
fn #name () {
#vis fn #name () {
serial_test::#fnname(#(#args ),*, || #block );
}
}
Expand Down

0 comments on commit 60eee70

Please sign in to comment.