From 4b3d200c0df3f7dc4f4dfa09f12aa731e84ff36c Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 26 Apr 2022 09:50:19 -0400 Subject: [PATCH] fixed cargo check issue --- packages/liveview/src/adapters/axum_adapter.rs | 1 - packages/liveview/src/adapters/warp_adapter.rs | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/liveview/src/adapters/axum_adapter.rs b/packages/liveview/src/adapters/axum_adapter.rs index 349ef5fe4..4122950bc 100644 --- a/packages/liveview/src/adapters/axum_adapter.rs +++ b/packages/liveview/src/adapters/axum_adapter.rs @@ -9,7 +9,6 @@ use tokio::sync::mpsc; use tokio_stream::wrappers::UnboundedReceiverStream; use tokio_util::task::LocalPoolHandle; -#[cfg(feature = "axum")] impl crate::Liveview { pub async fn upgrade(&self, ws: WebSocket, app: fn(Scope) -> Element) { connect(ws, self.pool.clone(), app, ()).await; diff --git a/packages/liveview/src/adapters/warp_adapter.rs b/packages/liveview/src/adapters/warp_adapter.rs index b73d02861..c6ec9106f 100644 --- a/packages/liveview/src/adapters/warp_adapter.rs +++ b/packages/liveview/src/adapters/warp_adapter.rs @@ -6,20 +6,19 @@ use tokio_stream::wrappers::UnboundedReceiverStream; use tokio_util::task::LocalPoolHandle; use warp::ws::{Message, WebSocket}; -#[cfg(feature = "warp")] impl crate::Liveview { pub async fn upgrade(&self, ws: warp::ws::WebSocket, app: fn(Scope) -> Element) { connect(ws, self.pool.clone(), app, ()).await; } - pub async fn upgrade_with_props(&self, ws: warp::ws::WebSocket, app: fn(Scope) -> Element, props: T) + pub async fn upgrade_with_props(&self, ws: warp::ws::WebSocket, app: fn(Scope) -> Element, props: T) where T: Send + Sync + 'static { - connect(ws, self.pool.clone(), app, props) + connect(ws, self.pool.clone(), app, props).await; } } -pub async fn connect(ws: WebSocket, pool: LocalPoolHandle, app: fn(Scope) -> Element, props: T) +pub async fn connect(ws: WebSocket, pool: LocalPoolHandle, app: fn(Scope) -> Element, props: T) where T: Send + Sync+ 'static {