@@ -79,7 +79,7 @@ inventory::submit! {
7979///
8080/// # Arguments
8181///
82- /// - `TokenStream` - The attribute token stream containing a list of function names.
82+ /// - `TokenStream` - The attribute token stream containing a list of function names or expressions .
8383/// - `TokenStream` - The input token stream to process.
8484/// - `Position` - The position to inject the code.
8585///
@@ -91,12 +91,12 @@ pub(crate) fn prologue_hooks_macro(
9191 item : TokenStream ,
9292 position : Position ,
9393) -> TokenStream {
94- let functions: Punctuated < Ident , Token ! [ , ] > =
94+ let functions: Punctuated < Expr , Token ! [ , ] > =
9595 parse_macro_input ! ( attr with Punctuated :: parse_terminated) ;
9696 inject ( position, item, |context| {
97- let hook_calls = functions. iter ( ) . map ( |function_name | {
97+ let hook_calls = functions. iter ( ) . map ( |function_expr | {
9898 quote ! {
99- let _ = #function_name ( #context. clone ( ) ) . await ;
99+ let _ = #function_expr ( #context) . await ;
100100 }
101101 } ) ;
102102 quote ! {
@@ -116,7 +116,7 @@ inventory::submit! {
116116///
117117/// # Arguments
118118///
119- /// - `TokenStream` - The attribute token stream containing a list of function names.
119+ /// - `TokenStream` - The attribute token stream containing a list of function names or expressions .
120120/// - `TokenStream` - The input token stream to process.
121121/// - `Position` - The position to inject the code.
122122///
@@ -128,12 +128,12 @@ pub(crate) fn epilogue_hooks_macro(
128128 item : TokenStream ,
129129 position : Position ,
130130) -> TokenStream {
131- let functions: Punctuated < Ident , Token ! [ , ] > =
131+ let functions: Punctuated < Expr , Token ! [ , ] > =
132132 parse_macro_input ! ( attr with Punctuated :: parse_terminated) ;
133133 inject ( position, item, |context| {
134- let hook_calls = functions. iter ( ) . map ( |function_name | {
134+ let hook_calls = functions. iter ( ) . map ( |function_expr | {
135135 quote ! {
136- let _ = #function_name ( #context. clone ( ) ) . await ;
136+ let _ = #function_expr ( #context) . await ;
137137 }
138138 } ) ;
139139 quote ! {
0 commit comments