xso: add support for ignoring unknown attributes
This commit is contained in:
parent
74c81b6a37
commit
290460ba9d
9 changed files with 185 additions and 23 deletions
|
|
@ -69,6 +69,7 @@ impl StructInner {
|
|||
debug,
|
||||
builder,
|
||||
iterator,
|
||||
on_unknown_attribute,
|
||||
transparent,
|
||||
} = meta;
|
||||
|
||||
|
|
@ -84,6 +85,7 @@ impl StructInner {
|
|||
if let Flag::Present(_) = transparent {
|
||||
reject_key!(namespace not on "transparent structs");
|
||||
reject_key!(name not on "transparent structs");
|
||||
reject_key!(on_unknown_attribute not on "transparent structs");
|
||||
|
||||
let fields_span = fields.span();
|
||||
let fields = match fields {
|
||||
|
|
@ -143,7 +145,7 @@ impl StructInner {
|
|||
};
|
||||
|
||||
Ok(Self::Compound {
|
||||
inner: Compound::from_fields(fields, &xml_namespace)?,
|
||||
inner: Compound::from_fields(fields, &xml_namespace, on_unknown_attribute)?,
|
||||
xml_namespace,
|
||||
xml_name,
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue