From dcfa3ca9a24edcfdf6d1e77c6f91fd125e451f25 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Sat, 8 Jun 2019 13:05:56 +0200 Subject: [PATCH] allow async api methods to return Response Signed-off-by: Wolfgang Bumiller --- proxmox-api-macro/src/api_macro.rs | 1 - proxmox-api/src/lib.rs | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/proxmox-api-macro/src/api_macro.rs b/proxmox-api-macro/src/api_macro.rs index 8f4f7e75..04fdcc35 100644 --- a/proxmox-api-macro/src/api_macro.rs +++ b/proxmox-api-macro/src/api_macro.rs @@ -196,7 +196,6 @@ fn handle_function( if item.asyncness.is_some() { // An async function is expected to return its value, so we wrap it a bit: - body.push(quote! { // Our helper type derefs to a wrapper performing input validation and returning a // Pin>. diff --git a/proxmox-api/src/lib.rs b/proxmox-api/src/lib.rs index 938343b1..5cb6f340 100644 --- a/proxmox-api/src/lib.rs +++ b/proxmox-api/src/lib.rs @@ -317,6 +317,9 @@ unconstrained_api_type! {&str} unconstrained_api_type! {String, isize, usize, i64, u64, i32, u32, i16, u16, i8, u8, f64, f32} unconstrained_api_type! {Vec} +// Raw return types are also okay: +unconstrained_api_type! {Response} + // FIXME: make const once feature(const_fn) is stable! pub fn get_type_info() -> &'static TypeInfo { T::type_info()