xso: refine handling of multiple #[xml(text)] fields
Previously, we only enforced the existence of at most one `#[xml(text)]` field only at code generation time for `FromXml`. This change enforces it at parsing time, which is more consistent and allows for a clearer error message.
This commit is contained in:
parent
ae30221e3c
commit
46584f05f9
3 changed files with 34 additions and 7 deletions
|
|
@ -329,4 +329,12 @@ impl FieldDef {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Return true if this field's parsing consumes text data.
|
||||
pub(crate) fn is_text_field(&self) -> bool {
|
||||
match self.kind {
|
||||
FieldKind::Text { .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue