xmpp-parsers: Switch to #[xml(lang)] wherever it’s possible

Link Mauve created

So far this new meta doesn’t work for the BTreeMap<Lang, String>
pattern, which is often used to provide multiple versions of a payload.

skip-changelog: This isn’t a user-facing change.

Change summary

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(-)

Detailed changes

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<String>,
 
     /// Name of this identity.

parsers/src/presence.rs 🔗

@@ -139,7 +139,7 @@ impl AsOptionalXmlText for Type {
 
 /// The main structure representing the `<presence/>` 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))]

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<String>,
 }
 

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<String>,
 }