From 741a83e1a59a9ed822ce6d1ab1a82d31a1cc854a Mon Sep 17 00:00:00 2001 From: hozan23 Date: Sat, 22 Jun 2024 05:21:42 +0200 Subject: net: compile rustls only if tls feature is enabled --- net/src/transports/tls.rs | 8 +++----- net/src/transports/ws.rs | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'net/src/transports') diff --git a/net/src/transports/tls.rs b/net/src/transports/tls.rs index c972f63..d282ad2 100644 --- a/net/src/transports/tls.rs +++ b/net/src/transports/tls.rs @@ -4,17 +4,15 @@ use async_trait::async_trait; use futures_util::SinkExt; use rustls_pki_types as pki_types; -#[cfg(feature = "smol")] -use futures_rustls::{rustls, TlsAcceptor, TlsConnector, TlsStream}; -#[cfg(feature = "tokio")] -use tokio_rustls::{rustls, TlsAcceptor, TlsConnector, TlsStream}; - use karyon_core::async_runtime::{ io::{split, ReadHalf, WriteHalf}, lock::Mutex, net::{TcpListener, TcpStream}, }; +#[cfg(feature = "tls")] +use crate::async_rustls::{rustls, TlsAcceptor, TlsConnector, TlsStream}; + use crate::{ codec::Codec, connection::{Conn, Connection, ToConn}, diff --git a/net/src/transports/ws.rs b/net/src/transports/ws.rs index f2fde90..eb339ca 100644 --- a/net/src/transports/ws.rs +++ b/net/src/transports/ws.rs @@ -10,16 +10,14 @@ use rustls_pki_types as pki_types; #[cfg(feature = "tokio")] use async_tungstenite::tokio as async_tungstenite; -#[cfg(all(feature = "smol", feature = "tls"))] -use futures_rustls::{rustls, TlsAcceptor, TlsConnector}; -#[cfg(all(feature = "tokio", feature = "tls"))] -use tokio_rustls::{rustls, TlsAcceptor, TlsConnector}; - use karyon_core::async_runtime::{ lock::Mutex, net::{TcpListener, TcpStream}, }; +#[cfg(feature = "tls")] +use crate::async_rustls::{rustls, TlsAcceptor, TlsConnector}; + use crate::{ codec::WebSocketCodec, connection::{Conn, Connection, ToConn}, -- cgit v1.2.3