From 7f0a7b22475e0e4170f7728008dd78db28aef250 Mon Sep 17 00:00:00 2001 From: Link Mauve Date: Wed, 23 Apr 2025 21:57:52 +0200 Subject: [PATCH] =?UTF-8?q?xmpp-parsers:=20Switch=20to=20#[xml(lang)]=20wh?= =?UTF-8?q?erever=20it=E2=80=99s=20possible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So far this new meta doesn’t work for the BTreeMap pattern, which is often used to provide multiple versions of a payload. skip-changelog: This isn’t a user-facing change. --- parsers/src/disco.rs | 2 +- parsers/src/presence.rs | 2 +- parsers/src/stream.rs | 2 +- parsers/src/websocket.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parsers/src/disco.rs b/parsers/src/disco.rs index 9e4957a18171a55e98d24b218dfc76c964e25246..9ee4a5fbd7ebebbd2c25b87e8b4d038c61e1e8e2 100644 --- a/parsers/src/disco.rs +++ b/parsers/src/disco.rs @@ -57,7 +57,7 @@ pub struct Identity { pub type_: String, /// Lang of the name of this identity. - #[xml(attribute(default, name = "xml:lang"))] + #[xml(lang(default))] pub lang: Option, /// Name of this identity. diff --git a/parsers/src/presence.rs b/parsers/src/presence.rs index 67634ddcdf03adb2f70f59544074934d4bf87b58..2242e8de87f0141e498c850e11a32ca4c88e10fc 100644 --- a/parsers/src/presence.rs +++ b/parsers/src/presence.rs @@ -139,7 +139,7 @@ impl AsOptionalXmlText for Type { /// The main structure representing the `` stanza. #[derive(FromXml, AsXml, Debug, Clone, PartialEq)] -#[xml(namespace = ns::DEFAULT_NS, name = "presence", discard(attribute = "xml:lang"))] +#[xml(namespace = ns::DEFAULT_NS, name = "presence")] pub struct Presence { /// The sender of this presence. #[xml(attribute(default))] diff --git a/parsers/src/stream.rs b/parsers/src/stream.rs index 0e8f929237c5f2284201f5a4084433eafb9d91df..1a6c9178870d11a4cd90fe69181429c7f3837c70 100644 --- a/parsers/src/stream.rs +++ b/parsers/src/stream.rs @@ -32,7 +32,7 @@ pub struct Stream { /// The default human language for all subsequent stanzas, which will /// be transmitted to other entities for better localisation. - #[xml(attribute(default, name = "xml:lang"))] + #[xml(lang(default))] xml_lang: Option, } diff --git a/parsers/src/websocket.rs b/parsers/src/websocket.rs index 6281da8459b58cf02b608ef92a41ae34ecd8b683..e448ee08bd78f46843bf346ee33788364a0b7860 100644 --- a/parsers/src/websocket.rs +++ b/parsers/src/websocket.rs @@ -32,7 +32,7 @@ pub struct Open { /// The default human language for all subsequent stanzas, which will /// be transmitted to other entities for better localisation. - #[xml(attribute(default, name = "xml:lang"))] + #[xml(lang(default))] pub xml_lang: Option, }