aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-05-30 14:26:09 +0100
committerLibravatar cel 🌸 <cel@bunny.garden>2025-05-30 14:26:09 +0100
commitb67e2d1897e0c9d1177b78d16019da4889b33db5 (patch)
tree202d713ad023f299ca71a88bb0a95bb122f8eaf8
parent4f23db0420ef6cd89c56690c3b795236a0f03c70 (diff)
downloadluz-b67e2d1897e0c9d1177b78d16019da4889b33db5.tar.gz
luz-b67e2d1897e0c9d1177b78d16019da4889b33db5.tar.bz2
luz-b67e2d1897e0c9d1177b78d16019da4889b33db5.zip
fix(luz): clean up warnings
-rw-r--r--Cargo.toml1
-rw-r--r--luz/Cargo.toml6
-rw-r--r--luz/src/client/ws.rs3
-rw-r--r--luz/src/connection/ws.rs7
-rw-r--r--luz/src/jabber_stream.rs12
-rw-r--r--luz/src/jabber_stream/ws.rs7
-rw-r--r--stanza/Cargo.toml2
7 files changed, 19 insertions, 19 deletions
diff --git a/Cargo.toml b/Cargo.toml
index ce563a0..63831e5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,6 +5,7 @@ members = ["luz", "lampada", "stanza", "jid", "filamento"]
[workspace.dependencies]
tokio = { version = "1.42.0" }
+jid = { path = "jid" }
peanuts = { version = "0.1.0", git = "https://bunny.garden/peanuts" }
thiserror = "2.0.11"
chrono = { version = "0.4.40" }
diff --git a/luz/Cargo.toml b/luz/Cargo.toml
index 878132b..b130a68 100644
--- a/luz/Cargo.toml
+++ b/luz/Cargo.toml
@@ -11,8 +11,6 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
async-recursion = "1.0.4"
-async-trait = "0.1.68"
-lazy_static = "1.4.0"
uuid = { version = "1.13.1", features = ["v4"] }
# TODO: remove unneeded features and dependencies
rsasl = { version = "2.0.1", default-features = false, features = [
@@ -24,9 +22,9 @@ rsasl = { version = "2.0.1", default-features = false, features = [
tracing = "0.1.40"
try_map = "0.3.1"
stanza = { version = "0.1.0", path = "../stanza", features = ["xep_0156"] }
-peanuts = { version = "0.1.0", git = "https://bunny.garden/peanuts" }
+peanuts = { workspace = true }
# peanuts = { version = "0.1.0", path = "../../peanuts" }
-jid = { version = "0.1.0", path = "../jid" }
+jid = { workspace = true }
futures = "0.3.30"
take_mut = "0.2.2"
pin-project-lite = "0.2.15"
diff --git a/luz/src/client/ws.rs b/luz/src/client/ws.rs
index ecb64cb..13c3cdf 100644
--- a/luz/src/client/ws.rs
+++ b/luz/src/client/ws.rs
@@ -5,8 +5,7 @@ use stanza::{
};
use crate::{
- connection::Ws, jabber_stream::bound_stream::BoundJabberStream, Connection, Error,
- JabberStream, Result, JID,
+ jabber_stream::bound_stream::BoundJabberStream, Connection, Error, JabberStream, Result, JID,
};
pub async fn connect_and_login(
diff --git a/luz/src/connection/ws.rs b/luz/src/connection/ws.rs
index caecf4a..e64a96e 100644
--- a/luz/src/connection/ws.rs
+++ b/luz/src/connection/ws.rs
@@ -1,5 +1,5 @@
use js_sys::Error;
-use peanuts::{reader::ReadableString, Reader};
+use peanuts::{ReadableString, Reader};
use stanza::xep_0156::XRD;
use tokio::sync::mpsc;
use tracing::debug;
@@ -91,7 +91,8 @@ impl Connection {
}
}) as Box<dyn FnMut()>);
let (send, mut error_recv) = mpsc::unbounded_channel();
- let onerror = Closure::<dyn FnMut(_)>::new(Box::new(move |e: ErrorEvent| {
+ // TODO: get error event message
+ let onerror = Closure::<dyn FnMut(_)>::new(Box::new(move |_e: ErrorEvent| {
// error will always be 1006, so doesn't matter.
tracing::error!("connection error");
match send.send(()) {
@@ -106,7 +107,7 @@ impl Connection {
tokio::select! {
_error = error_recv.recv() => { Err(ConnectionError::Connect(url.to_string()))? },
- Some(open) = open_recv.recv() => { },
+ Some(_open) = open_recv.recv() => { },
else => { Err(ConnectionError::Connect(url.to_string()))? }
}
diff --git a/luz/src/jabber_stream.rs b/luz/src/jabber_stream.rs
index f372153..f77e6a9 100644
--- a/luz/src/jabber_stream.rs
+++ b/luz/src/jabber_stream.rs
@@ -8,9 +8,9 @@ use std::str::{self, FromStr};
use std::sync::Arc;
use jid::JID;
-#[cfg(target_arch = "wasm32")]
-use peanuts::reader::WebSocketOnMessageRead;
use peanuts::IntoElement;
+#[cfg(target_arch = "wasm32")]
+use peanuts::WebSocketOnMessageRead;
use peanuts::{Reader, Writer};
use rsasl::prelude::{Mechname, SASLClient, SASLConfig};
use stanza::bind::{Bind, BindType, FullJidType, ResourceType};
@@ -19,8 +19,12 @@ use stanza::client::Stanza;
#[cfg(target_arch = "wasm32")]
use stanza::rfc_7395::Open;
use stanza::sasl::{Auth, Challenge, Mechanisms, Response, ServerResponse};
+#[cfg(not(target_arch = "wasm32"))]
use stanza::starttls::{Proceed, StartTls};
-use stanza::stream::{Features, Stream};
+use stanza::stream::Features;
+#[cfg(not(target_arch = "wasm32"))]
+use stanza::stream::Stream;
+#[cfg(not(target_arch = "wasm32"))]
use stanza::XML_VERSION;
#[cfg(not(target_arch = "wasm32"))]
use tokio_native_tls::native_tls::TlsConnector;
@@ -31,8 +35,6 @@ use web_sys::{wasm_bindgen::JsCast, WebSocket};
use crate::connection::Connection;
#[cfg(not(target_arch = "wasm32"))]
use crate::connection::Tls;
-#[cfg(target_arch = "wasm32")]
-use crate::connection::Ws;
use crate::error::Error;
use crate::Result;
diff --git a/luz/src/jabber_stream/ws.rs b/luz/src/jabber_stream/ws.rs
index 35b6f60..72801e6 100644
--- a/luz/src/jabber_stream/ws.rs
+++ b/luz/src/jabber_stream/ws.rs
@@ -1,10 +1,9 @@
-use peanuts::loggable::Loggable;
-use peanuts::reader::WebSocketOnMessageRead;
+use peanuts::WebSocketOnMessageRead;
use peanuts::{Reader, Writer};
use stanza::rfc_7395::Close;
use web_sys::WebSocket;
-use crate::{Connection, Result};
+use crate::Result;
// open stream (streams started)
#[derive(Debug)]
@@ -43,7 +42,7 @@ impl JabberReader {
impl JabberReader {
pub async fn try_close(&mut self) -> Result<()> {
- let close: Close = self.read().await?;
+ let _close: Close = self.read().await?;
Ok(())
}
}
diff --git a/stanza/Cargo.toml b/stanza/Cargo.toml
index 4f324e8..884584a 100644
--- a/stanza/Cargo.toml
+++ b/stanza/Cargo.toml
@@ -5,7 +5,7 @@ edition = "2021"
[dependencies]
peanuts = { workspace = true }
-jid = { version = "0.1.0", path = "../jid" }
+jid = { workspace = true }
thiserror = { workspace = true }
chrono = { workspace = true, optional = true }