diff --git a/src/api.rs b/src/api.rs index 79f04a1..84b8b2f 100644 --- a/src/api.rs +++ b/src/api.rs @@ -17,7 +17,10 @@ use diesel::{ExpressionMethods, OptionalExtension, QueryDsl, SelectableHelper}; use diesel_async::{scoped_futures::ScopedFutureExt, AsyncConnection, RunQueryDsl}; use futures_util::Stream; use serde::Deserialize; -use tokio_stream::{wrappers::errors::BroadcastStreamRecvError, StreamExt as _}; +use tokio_stream::{ + wrappers::{errors::BroadcastStreamRecvError, BroadcastStream}, + StreamExt as _, +}; use crate::AppState; @@ -178,9 +181,8 @@ async fn add_dancer( async fn ada_subscribe( State(state): State, ) -> Sse>> { - let stream = - tokio_stream::wrappers::BroadcastStream::new(state.sse_handler.ada_sender.subscribe()) - .map(|r| r.map(|s| Event::default().event("ada").data(s))); + let stream = BroadcastStream::new(state.sse_handler.ada_sender.subscribe()) + .map(|r| r.map(|s| Event::default().event("ada").data(s))); Sse::new(stream).keep_alive(KeepAlive::default()) }