diff --git a/proxmox-api-macro/src/api.rs b/proxmox-api-macro/src/api.rs index f3ca9571..bf8360ca 100644 --- a/proxmox-api-macro/src/api.rs +++ b/proxmox-api-macro/src/api.rs @@ -105,13 +105,10 @@ impl TryFrom for Schema { span: obj.brace_token.span, description, item: SchemaItem::try_extract_from(&mut obj)?, - properties: obj.into_iter().try_fold( - Vec::new(), - |mut properties, (key, value)| -> Result<_, syn::Error> { - properties.push((key.into_ident(), value.try_into()?)); - Ok(properties) - }, - )?, + properties: obj + .into_iter() + .map(|(key, value)| Ok((key.into_ident(), value.try_into()?))) + .collect::>()?, }) } }