From 025eaf551915fe603a25c0cf1ebb0a2b97e44591 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 16 Aug 2019 12:21:31 +0200 Subject: [PATCH] api-macro: fix non-async test case after adding verifiers Signed-off-by: Wolfgang Bumiller --- proxmox-api-macro/src/api_macro/function.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proxmox-api-macro/src/api_macro/function.rs b/proxmox-api-macro/src/api_macro/function.rs index cb7ec1de..0f8a5eea 100644 --- a/proxmox-api-macro/src/api_macro/function.rs +++ b/proxmox-api-macro/src/api_macro/function.rs @@ -286,7 +286,13 @@ pub fn handle_function( body.push(quote! { impl #struct_name { fn #impl_checked_ident(#inputs) -> ::proxmox::api::ApiFuture<#body_type> { - #parameter_verifiers + let check = (|| -> Result<(), Error> { + #parameter_verifiers + Ok(()) + })(); + if let Err(err) = check { + return Box::pin(async move { Err(err) }); + } Self::#impl_unchecked_ident(#passed_args) } }