mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-28 13:26:52 +00:00
macro: recurse into struct field verifiers
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
3c31381fb2
commit
14acfcd5cd
@ -605,6 +605,13 @@ fn named_struct_impl_verify(span: Span, fields: &[StructField]) -> Result<TokenS
|
||||
let field_ident = field.ident;
|
||||
let field_str = &field.strlit;
|
||||
|
||||
// first of all, recurse into the contained types:
|
||||
body.extend(quote_spanned! { field_ident.span() =>
|
||||
::proxmox::api::ApiType::verify(&self.#field_ident)?;
|
||||
});
|
||||
|
||||
// then go through all the additional verifiers:
|
||||
|
||||
if let Some(ref value) = field.def.minimum {
|
||||
body.extend(quote_spanned! { value.span() =>
|
||||
let value = #value;
|
||||
|
Loading…
Reference in New Issue
Block a user