From a4b3960f1a2cb8bd8b557833cc23449278dd4895 Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Fri, 9 Aug 2024 03:43:37 +0530 Subject: [PATCH] fix: enable sync only for builds without websocket support --- rumqttc/src/framed.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rumqttc/src/framed.rs b/rumqttc/src/framed.rs index ec0e6ba6d..71d111d36 100644 --- a/rumqttc/src/framed.rs +++ b/rumqttc/src/framed.rs @@ -92,5 +92,11 @@ impl Network { } } -pub trait AsyncReadWrite: AsyncRead + AsyncWrite + Send + Sync + Unpin {} -impl AsyncReadWrite for T where T: AsyncRead + AsyncWrite + Send + Sync + Unpin {} +#[cfg(not(feature = "websocket"))] +pub trait AsyncReadWrite: AsyncRead + AsyncWrite + Send + Unpin {} +#[cfg(not(feature = "websocket"))] +impl AsyncReadWrite for T where T: AsyncRead + AsyncWrite + Send + Unpin {} +#[cfg(feature = "websocket")] +pub trait AsyncReadWrite: AsyncRead + AsyncWrite + Send + Unpin {} +#[cfg(feature = "websocket")] +impl AsyncReadWrite for T where T: AsyncRead + AsyncWrite + Send + Unpin {}