api-macro: fix non-async test case after adding verifiers
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
9fd9bd53fd
commit
025eaf5519
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user