aboutsummaryrefslogtreecommitdiffstats
path: root/src/connection.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/connection.rs')
-rw-r--r--src/connection.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/connection.rs b/src/connection.rs
index b42711e..89f382f 100644
--- a/src/connection.rs
+++ b/src/connection.rs
@@ -8,8 +8,8 @@ use tokio_native_tls::native_tls::TlsConnector;
use tokio_native_tls::TlsStream;
use tracing::{debug, info, instrument, trace};
+use crate::Error;
use crate::Jabber;
-use crate::JabberError;
use crate::Result;
pub type Tls = TlsStream<TcpStream>;
@@ -75,7 +75,7 @@ impl Connection {
}
}
}
- Err(JabberError::Connection)
+ Err(Error::Connection)
}
#[instrument]
@@ -154,19 +154,19 @@ impl Connection {
pub async fn connect_tls(socket_addr: SocketAddr, domain_name: &str) -> Result<Tls> {
let socket = TcpStream::connect(socket_addr)
.await
- .map_err(|_| JabberError::Connection)?;
- let connector = TlsConnector::new().map_err(|_| JabberError::Connection)?;
+ .map_err(|_| Error::Connection)?;
+ let connector = TlsConnector::new().map_err(|_| Error::Connection)?;
tokio_native_tls::TlsConnector::from(connector)
.connect(domain_name, socket)
.await
- .map_err(|_| JabberError::Connection)
+ .map_err(|_| Error::Connection)
}
#[instrument]
pub async fn connect_unencrypted(socket_addr: SocketAddr) -> Result<Unencrypted> {
TcpStream::connect(socket_addr)
.await
- .map_err(|_| JabberError::Connection)
+ .map_err(|_| Error::Connection)
}
}