api-macro: minor cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2020-04-14 11:45:50 +02:00
parent b67e2f7214
commit 0b2c9b95b4

View File

@ -36,9 +36,7 @@ pub fn handle_method(mut attribs: JSONObject, mut func: syn::ItemFn) -> Result<T
let mut returns_schema: Option<Schema> = attribs
.remove("returns")
.map(|ret| ret.into_object("return schema definition"))
.transpose()?
.map(|ret| ret.try_into())
.map(|ret| ret.into_object("return schema definition")?.try_into())
.transpose()?;
let protected: bool = attribs