diff options
Diffstat (limited to 'stanza/src/xep_0030')
-rw-r--r-- | stanza/src/xep_0030/info.rs | 17 | ||||
-rw-r--r-- | stanza/src/xep_0030/items.rs | 13 |
2 files changed, 12 insertions, 18 deletions
diff --git a/stanza/src/xep_0030/info.rs b/stanza/src/xep_0030/info.rs index 539934f..0344ccb 100644 --- a/stanza/src/xep_0030/info.rs +++ b/stanza/src/xep_0030/info.rs @@ -1,7 +1,4 @@ -use peanuts::{ - element::{FromElement, IntoElement}, - DeserializeError, Element, XML_NS, -}; +use peanuts::{DeserializeError, Element, FromElement, IntoElement, XML_NS}; #[cfg(feature = "xep_0128")] use crate::xep_0004::X; @@ -22,7 +19,7 @@ pub struct Query { } impl FromElement for Query { - fn from_element(mut element: peanuts::Element) -> peanuts::element::DeserializeResult<Self> { + fn from_element(mut element: peanuts::Element) -> peanuts::DeserializeResult<Self> { element.check_name("query")?; element.check_namespace(XMLNS)?; @@ -50,7 +47,7 @@ impl FromElement for Query { } impl IntoElement for Query { - fn builder(&self) -> peanuts::element::ElementBuilder { + fn builder(&self) -> peanuts::ElementBuilder { let builder = Element::builder("query", Some(XMLNS)) .push_attribute_opt("node", self.node.clone()) .push_children(self.features.clone()) @@ -78,7 +75,7 @@ pub struct Identity { } impl FromElement for Identity { - fn from_element(mut element: peanuts::Element) -> peanuts::element::DeserializeResult<Self> { + fn from_element(mut element: peanuts::Element) -> peanuts::DeserializeResult<Self> { element.check_name("identity")?; element.check_namespace(XMLNS)?; @@ -109,7 +106,7 @@ impl FromElement for Identity { } impl IntoElement for Identity { - fn builder(&self) -> peanuts::element::ElementBuilder { + fn builder(&self) -> peanuts::ElementBuilder { Element::builder("identity", Some(XMLNS)) .push_attribute("category", self.category.clone()) .push_attribute_opt("name", self.name.clone()) @@ -124,7 +121,7 @@ pub struct Feature { } impl FromElement for Feature { - fn from_element(mut element: peanuts::Element) -> peanuts::element::DeserializeResult<Self> { + fn from_element(mut element: peanuts::Element) -> peanuts::DeserializeResult<Self> { element.check_name("feature")?; element.check_namespace(XMLNS)?; @@ -135,7 +132,7 @@ impl FromElement for Feature { } impl IntoElement for Feature { - fn builder(&self) -> peanuts::element::ElementBuilder { + fn builder(&self) -> peanuts::ElementBuilder { Element::builder("feature", Some(XMLNS)).push_attribute("var", self.var.clone()) } } diff --git a/stanza/src/xep_0030/items.rs b/stanza/src/xep_0030/items.rs index 471f3e1..7707eac 100644 --- a/stanza/src/xep_0030/items.rs +++ b/stanza/src/xep_0030/items.rs @@ -1,8 +1,5 @@ use jid::JID; -use peanuts::{ - element::{FromElement, IntoElement}, - Element, -}; +use peanuts::{Element, FromElement, IntoElement}; #[cfg(feature = "xep_0059")] use crate::xep_0059::Set; @@ -18,7 +15,7 @@ pub struct Query { } impl FromElement for Query { - fn from_element(mut element: Element) -> peanuts::element::DeserializeResult<Self> { + fn from_element(mut element: Element) -> peanuts::DeserializeResult<Self> { element.check_name("query")?; element.check_namespace(XMLNS)?; @@ -39,7 +36,7 @@ impl FromElement for Query { } impl IntoElement for Query { - fn builder(&self) -> peanuts::element::ElementBuilder { + fn builder(&self) -> peanuts::ElementBuilder { let builder = Element::builder("query", Some(XMLNS)) .push_attribute_opt("node", self.node.clone()) .push_children(self.items.clone()); @@ -59,7 +56,7 @@ pub struct Item { } impl FromElement for Item { - fn from_element(mut element: Element) -> peanuts::element::DeserializeResult<Self> { + fn from_element(mut element: Element) -> peanuts::DeserializeResult<Self> { element.check_name("item")?; element.check_namespace(XMLNS)?; @@ -72,7 +69,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("jid", self.jid.clone()) .push_attribute_opt("name", self.name.clone()) |