aboutsummaryrefslogtreecommitdiff
path: root/net/src/stream
diff options
context:
space:
mode:
authorhozan23 <hozan23@karyontech.net>2024-06-22 05:21:42 +0200
committerhozan23 <hozan23@karyontech.net>2024-06-22 05:21:42 +0200
commit741a83e1a59a9ed822ce6d1ab1a82d31a1cc854a (patch)
tree4fd02b04967aceed1a59b573f8e0b4677e7a9063 /net/src/stream
parent9aa972dd83a85cec5da71e8e893eb6e07d5db8ca (diff)
net: compile rustls only if tls feature is enabled
Diffstat (limited to 'net/src/stream')
-rw-r--r--net/src/stream/websocket.rs16
1 files changed, 7 insertions, 9 deletions
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<T> =
async_tungstenite::WebSocketStream<async_tungstenite::tokio::TokioAdapter<T>>;
#[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<C> {
inner: InnerWSConn,
codec: C,