aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-02-25 19:45:35 +0000
committerLibravatar cel 🌸 <cel@bunny.garden>2025-02-25 19:45:35 +0000
commitea87cc407c40e8ef5162a3a4457ed0b1bfcf4a55 (patch)
treeef608d5c4c6765dff5b43eb1a4e4e814ba7a7acd
parent90a5af5c751e5d4f4dcbe01f9df695708229235d (diff)
downloadluz-ea87cc407c40e8ef5162a3a4457ed0b1bfcf4a55.tar.gz
luz-ea87cc407c40e8ef5162a3a4457ed0b1bfcf4a55.tar.bz2
luz-ea87cc407c40e8ef5162a3a4457ed0b1bfcf4a55.zip
cleanup
-rw-r--r--stanza/src/bind.rs8
-rw-r--r--stanza/src/client/mod.rs2
-rw-r--r--stanza/src/starttls.rs4
-rw-r--r--stanza/src/stream.rs8
4 files changed, 9 insertions, 13 deletions
diff --git a/stanza/src/bind.rs b/stanza/src/bind.rs
index 63644b1..07a8c0f 100644
--- a/stanza/src/bind.rs
+++ b/stanza/src/bind.rs
@@ -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()?;
diff --git a/stanza/src/client/mod.rs b/stanza/src/client/mod.rs
index 11ba616..1f36dc3 100644
--- a/stanza/src/client/mod.rs
+++ b/stanza/src/client/mod.rs
@@ -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;
diff --git a/stanza/src/starttls.rs b/stanza/src/starttls.rs
index fb66711..b0e0f0f 100644
--- a/stanza/src/starttls.rs
+++ b/stanza/src/starttls.rs
@@ -1,7 +1,5 @@
-use std::collections::{HashMap, HashSet};
-
use peanuts::{
- element::{Content, FromElement, IntoElement, Name, NamespaceDeclaration},
+ element::{FromElement, IntoElement},
Element,
};
diff --git a/stanza/src/stream.rs b/stanza/src/stream.rs
index 89b03d8..069dcd1 100644
--- a/stanza/src/stream.rs
+++ b/stanza/src/stream.rs
@@ -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";