aboutsummaryrefslogtreecommitdiffstats
path: root/jabber/src/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'jabber/src/client.rs')
-rw-r--r--jabber/src/client.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/jabber/src/client.rs b/jabber/src/client.rs
index 1662483..de2be08 100644
--- a/jabber/src/client.rs
+++ b/jabber/src/client.rs
@@ -19,7 +19,8 @@ pub async fn connect_and_login(
None,
jid.localpart.clone().ok_or(Error::NoLocalpart)?,
password.as_ref().to_string(),
- )?;
+ )
+ .map_err(|e| Error::SASL(e.into()))?;
let mut conn_state = Connecting::start(&server).await?;
loop {
match conn_state {
@@ -108,9 +109,8 @@ pub enum InsecureConnecting {
#[cfg(test)]
mod tests {
- use std::{sync::Arc, time::Duration};
+ use std::time::Duration;
- use futures::{SinkExt, StreamExt};
use jid::JID;
use stanza::{
client::{
@@ -120,7 +120,7 @@ mod tests {
xep_0199::Ping,
};
use test_log::test;
- use tokio::{sync::Mutex, time::sleep};
+ use tokio::time::sleep;
use tracing::info;
use super::connect_and_login;
@@ -128,7 +128,7 @@ mod tests {
#[test(tokio::test)]
async fn login() {
let mut jid: JID = "test@blos.sm".try_into().unwrap();
- let client = connect_and_login(&mut jid, "slayed", &mut "blos.sm".to_string())
+ let _client = connect_and_login(&mut jid, "slayed", &mut "blos.sm".to_string())
.await
.unwrap();
sleep(Duration::from_secs(5)).await