This commit is contained in:
cel 🌸 2025-02-25 19:45:35 +00:00
parent 90a5af5c75
commit ea87cc407c
4 changed files with 9 additions and 13 deletions

View File

@ -13,8 +13,8 @@ pub struct Bind {
impl FromElement for Bind {
fn from_element(mut element: peanuts::Element) -> peanuts::element::DeserializeResult<Self> {
element.check_name("bind");
element.check_name(XMLNS);
element.check_name("bind")?;
element.check_name(XMLNS)?;
let r#type = element.pop_child_opt()?;
@ -61,8 +61,8 @@ pub struct FullJidType(pub JID);
impl FromElement for FullJidType {
fn from_element(mut element: peanuts::Element) -> peanuts::element::DeserializeResult<Self> {
element.check_name("jid");
element.check_namespace(XMLNS);
element.check_name("jid")?;
element.check_namespace(XMLNS)?;
let jid = element.pop_value()?;

View File

@ -1,7 +1,7 @@
use iq::Iq;
use message::Message;
use peanuts::{
element::{Content, ContentBuilder, FromContent, FromElement, IntoContent, IntoElement},
element::{Content, ContentBuilder, FromContent, FromElement, IntoContent},
DeserializeError,
};
use presence::Presence;

View File

@ -1,7 +1,5 @@
use std::collections::{HashMap, HashSet};
use peanuts::{
element::{Content, FromElement, IntoElement, Name, NamespaceDeclaration},
element::{FromElement, IntoElement},
Element,
};

View File

@ -1,15 +1,13 @@
use std::collections::{HashMap, HashSet};
use jid::JID;
use peanuts::element::{Content, ElementBuilder, FromElement, IntoElement, NamespaceDeclaration};
use peanuts::{element::Name, Element};
use peanuts::element::{ElementBuilder, FromElement, IntoElement};
use peanuts::Element;
use crate::bind;
use super::client;
use super::sasl::{self, Mechanisms};
use super::starttls::{self, StartTls};
use super::stream_error::{Error as StreamError, Text};
use super::{client, stream_error};
pub const XMLNS: &str = "http://etherx.jabber.org/streams";