mirror of
https://git.proxmox.com/git/proxmox
synced 2025-10-04 15:15:35 +00:00
api-macro: reorganize field iteration
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
9207e8aa9a
commit
46fe5832fb
@ -86,20 +86,18 @@ fn handle_regular_struct(
|
|||||||
|
|
||||||
let ident_name: String = ident.to_string();
|
let ident_name: String = ident.to_string();
|
||||||
|
|
||||||
let field_def: &mut (FieldName, bool, Schema) = match schema_fields.remove(&ident_name)
|
match schema_fields.remove(&ident_name) {
|
||||||
{
|
Some(field_def) => handle_regular_field(field_def, field)?,
|
||||||
Some(field) => field,
|
|
||||||
None => {
|
None => {
|
||||||
new_fields.push((
|
let mut field_def = (
|
||||||
FieldName::new(ident_name.clone(), ident.span()),
|
FieldName::new(ident_name.clone(), ident.span()),
|
||||||
false,
|
false,
|
||||||
Schema::blank(ident.span()),
|
Schema::blank(ident.span()),
|
||||||
));
|
);
|
||||||
new_fields.last_mut().unwrap()
|
handle_regular_field(&mut field_def, field)?;
|
||||||
|
new_fields.push(field_def);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
handle_regular_field(field_def, field)?;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unreachable!();
|
unreachable!();
|
||||||
|
Loading…
Reference in New Issue
Block a user