replace qualified path with use
This commit is contained in:
parent
dfce42fd03
commit
239b332b48
1 changed files with 6 additions and 4 deletions
10
src/api.rs
10
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<AppState>,
|
||||
) -> Sse<impl Stream<Item = Result<Event, BroadcastStreamRecvError>>> {
|
||||
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())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue