diff options
Diffstat (limited to '')
| -rw-r--r-- | jabber/src/client.rs | 16 | ||||
| -rw-r--r-- | jabber/src/connection.rs | 2 | ||||
| -rw-r--r-- | jabber/src/jabber_stream.rs | 12 | ||||
| -rw-r--r-- | jabber/src/jabber_stream/bound_stream.rs | 5 | ||||
| -rw-r--r-- | jabber/src/lib.rs | 1 | 
5 files changed, 5 insertions, 31 deletions
| diff --git a/jabber/src/client.rs b/jabber/src/client.rs index f741352..1662483 100644 --- a/jabber/src/client.rs +++ b/jabber/src/client.rs @@ -1,29 +1,17 @@ -use std::{ -    borrow::Borrow, -    future::Future, -    pin::pin, -    sync::Arc, -    task::{ready, Poll}, -}; - -use futures::{FutureExt, Sink, SinkExt, Stream, StreamExt}; -use jid::ParseError;  use rsasl::config::SASLConfig;  use stanza::{ -    client::Stanza,      sasl::Mechanisms,      stream::{Feature, Features},  }; -use tokio::sync::Mutex;  use crate::{      connection::{Tls, Unencrypted}, -    jabber_stream::bound_stream::{BoundJabberReader, BoundJabberStream}, +    jabber_stream::bound_stream::BoundJabberStream,      Connection, Error, JabberStream, Result, JID,  };  pub async fn connect_and_login( -    mut jid: &mut JID, +    jid: &mut JID,      password: impl AsRef<str>,      server: &mut String,  ) -> Result<BoundJabberStream<Tls>> { diff --git a/jabber/src/connection.rs b/jabber/src/connection.rs index bc5a282..b185eca 100644 --- a/jabber/src/connection.rs +++ b/jabber/src/connection.rs @@ -1,9 +1,7 @@  use std::net::{IpAddr, SocketAddr};  use std::str;  use std::str::FromStr; -use std::sync::Arc; -use rsasl::config::SASLConfig;  use tokio::net::TcpStream;  use tokio_native_tls::native_tls::TlsConnector;  // TODO: use rustls diff --git a/jabber/src/jabber_stream.rs b/jabber/src/jabber_stream.rs index c38f930..6fa92b5 100644 --- a/jabber/src/jabber_stream.rs +++ b/jabber/src/jabber_stream.rs @@ -1,10 +1,8 @@ -use std::pin::pin;  use std::str::{self, FromStr};  use std::sync::Arc; -use futures::{sink, stream, StreamExt};  use jid::JID; -use peanuts::element::{FromContent, IntoElement}; +use peanuts::element::IntoElement;  use peanuts::{Reader, Writer};  use rsasl::prelude::{Mechname, SASLClient, SASLConfig};  use stanza::bind::{Bind, BindType, FullJidType, ResourceType}; @@ -141,7 +139,7 @@ where          let mut session = sasl.start_suggested(&offered_mechs)?;          let selected_mechanism = session.get_mechname().as_str().to_owned();          debug!("selected mech: {:?}", selected_mechanism); -        let mut data: Option<Vec<u8>> = None; +        let mut data: Option<Vec<u8>>;          if !session.are_we_first() {              // if not first mention the mechanism then get challenge data @@ -409,13 +407,7 @@ impl std::fmt::Debug for JabberStream<Unencrypted> {  #[cfg(test)]  mod tests { -    use std::time::Duration; - -    use super::*; -    use crate::connection::Connection; -    use futures::sink;      use test_log::test; -    use tokio::time::sleep;      #[test(tokio::test)]      async fn start_stream() { diff --git a/jabber/src/jabber_stream/bound_stream.rs b/jabber/src/jabber_stream/bound_stream.rs index 51a1763..25b79ff 100644 --- a/jabber/src/jabber_stream/bound_stream.rs +++ b/jabber/src/jabber_stream/bound_stream.rs @@ -1,9 +1,6 @@  use std::ops::{Deref, DerefMut}; -use peanuts::{Reader, Writer}; -use tokio::io::{AsyncRead, AsyncWrite, ReadHalf, WriteHalf}; - -use crate::Error; +use tokio::io::{AsyncRead, AsyncWrite};  use super::{JabberReader, JabberStream, JabberWriter}; diff --git a/jabber/src/lib.rs b/jabber/src/lib.rs index 7258f38..8855ca7 100644 --- a/jabber/src/lib.rs +++ b/jabber/src/lib.rs @@ -8,7 +8,6 @@ pub mod error;  pub mod jabber_stream;  pub use connection::Connection; -use connection::Tls;  pub use error::Error;  pub use jabber_stream::JabberStream;  pub use jid::JID; | 
