diff --git a/examples/arsnova-client-tui.rs b/examples/arsnova-client-tui.rs index b49d73f..063bc90 100644 --- a/examples/arsnova-client-tui.rs +++ b/examples/arsnova-client-tui.rs @@ -32,7 +32,7 @@ use ratatui::text::{Line, Span}; use ratatui::widgets::Paragraph; use ratatui::Terminal; use tokio::select; -use tokio::sync::mpsc::Receiver; +use tokio::sync::mpsc::{channel, Receiver}; use arsnova_client::{Client, Feedback, FeedbackHandler}; @@ -69,7 +69,7 @@ async fn main() -> Result<(), ()> { let mut terminal = Terminal::new(CrosstermBackend::new(stdout())).map_err(|_| ())?; terminal.clear().map_err(|_| ())?; - let (tx, rx) = tokio::sync::mpsc::channel::(10); + let (tx, rx) = channel::(10); let l1 = client.on_feedback_changed(&cli.room, FeedbackHandler::Sender(tx.clone())); diff --git a/src/client.rs b/src/client.rs index 2975bc1..1e92b22 100644 --- a/src/client.rs +++ b/src/client.rs @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -use std::fmt::Display; +use std::fmt::{Display, Formatter}; use std::time::Duration; use futures_util::{SinkExt, StreamExt}; @@ -57,7 +57,7 @@ impl WsConnectMessage { } impl Display for WsConnectMessage { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { let str = format!( "CONNECT\ntoken:{}\naccept-version:1.2,1.1,1.0\nheart-beat:20000,0\n\n\0", self.token @@ -113,7 +113,7 @@ impl WsFeedbackPayload { } impl Display for WsSubscribeMessage { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { let str = format!( "SUBSCRIBE\nid:sub-6\ndestination:/topic/{}.feedback.stream\n\n\0", self.room_id