From ba4fd6d8e9ca18cc18e75d48ab8a3a0bebc7b4e4 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Fri, 30 May 2025 14:01:24 +0100 Subject: chore(stanza): update peanuts and use workspace deps --- stanza/src/roster.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'stanza/src/roster.rs') diff --git a/stanza/src/roster.rs b/stanza/src/roster.rs index 0181193..14f65ef 100644 --- a/stanza/src/roster.rs +++ b/stanza/src/roster.rs @@ -1,10 +1,7 @@ use std::str::FromStr; use jid::JID; -use peanuts::{ - element::{FromElement, IntoElement}, - DeserializeError, Element, -}; +use peanuts::{DeserializeError, Element, FromElement, IntoElement}; pub const XMLNS: &str = "jabber:iq:roster"; @@ -15,7 +12,7 @@ pub struct Query { } impl FromElement for Query { - fn from_element(mut element: Element) -> peanuts::element::DeserializeResult { + fn from_element(mut element: Element) -> peanuts::DeserializeResult { element.check_name("query")?; element.check_namespace(XMLNS)?; @@ -27,7 +24,7 @@ impl FromElement for Query { } impl IntoElement for Query { - fn builder(&self) -> peanuts::element::ElementBuilder { + fn builder(&self) -> peanuts::ElementBuilder { Element::builder("query", Some(XMLNS)) .push_attribute_opt("ver", self.ver.clone()) .push_children(self.items.clone()) @@ -50,7 +47,7 @@ pub struct Item { } impl FromElement for Item { - fn from_element(mut element: Element) -> peanuts::element::DeserializeResult { + fn from_element(mut element: Element) -> peanuts::DeserializeResult { element.check_name("item")?; element.check_namespace(XMLNS)?; @@ -83,7 +80,7 @@ impl FromElement for Item { } impl IntoElement for Item { - fn builder(&self) -> peanuts::element::ElementBuilder { + fn builder(&self) -> peanuts::ElementBuilder { Element::builder("item", Some(XMLNS)) .push_attribute_opt("approved", self.approved) .push_attribute_opt( @@ -143,7 +140,7 @@ impl ToString for Subscription { pub struct Group(pub Option); impl FromElement for Group { - fn from_element(mut element: peanuts::Element) -> peanuts::element::DeserializeResult { + fn from_element(mut element: peanuts::Element) -> peanuts::DeserializeResult { element.check_name("group")?; element.check_namespace(XMLNS)?; @@ -154,7 +151,7 @@ impl FromElement for Group { } impl IntoElement for Group { - fn builder(&self) -> peanuts::element::ElementBuilder { + fn builder(&self) -> peanuts::ElementBuilder { Element::builder("group", Some(XMLNS)).push_text_opt(self.0.clone()) } } -- cgit