xmpp-parsers: Use the new lang meta everywhere

Stop parsing xml:lang manually, instead use the #[xml(lang)] meta which
tracks it using the XML semantics, inheriting it from the most recent
ancestor.

skip-changelog: This isn’t a user-facing change.
This commit is contained in:
Link Mauve 2025-05-14 02:01:31 +02:00
commit 3920ad3819
8 changed files with 12 additions and 9 deletions

View file

@ -307,7 +307,10 @@ pub struct StreamError {
/// Optional error text. The first part is the optional `xml:lang`
/// language tag, the second part is the actual text content.
#[xml(extract(default, fields(attribute(name = "xml:lang", default, type_ = Option<String>), text(type_ = String))))]
#[xml(extract(default, fields(
lang(type_ = Option<String>, default),
text(type_ = String),
)))]
pub text: Option<(Option<String>, String)>,
/// Optional application-defined element which refines the specified