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/stream/websocket.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'net/src/stream') diff --git a/net/src/stream/websocket.rs b/net/src/stream/websocket.rs index eb4de21..9f4da46 100644 --- a/net/src/stream/websocket.rs +++ b/net/src/stream/websocket.rs @@ -10,21 +10,19 @@ use futures_util::{ }; use pin_project_lite::pin_project; -#[cfg(all(feature = "smol", feature = "tls"))] -use futures_rustls::TlsStream; -#[cfg(all(feature = "tokio", feature = "tls"))] -use tokio_rustls::TlsStream; - -use karyon_core::async_runtime::net::TcpStream; - -use crate::{codec::WebSocketCodec, Error, Result}; - #[cfg(feature = "tokio")] type WebSocketStream = async_tungstenite::WebSocketStream>; #[cfg(feature = "smol")] use async_tungstenite::WebSocketStream; +use karyon_core::async_runtime::net::TcpStream; + +#[cfg(feature = "tls")] +use crate::async_rustls::TlsStream; + +use crate::{codec::WebSocketCodec, Error, Result}; + pub struct WsStream { inner: InnerWSConn, codec: C, -- cgit v1.2.3