Skip to content

Commit 06ece6a

Browse files
committed
Remove unneded let _ = in websocket example
1 parent f37d068 commit 06ece6a

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

examples/websocket/src/echo.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,15 @@ pub fn connect() -> impl Sipper<Never, Event> {
2222
Ok((websocket, _)) => {
2323
let (sender, receiver) = mpsc::channel(100);
2424

25-
let _ = output
26-
.send(Event::Connected(Connection(sender)))
27-
.await;
25+
output.send(Event::Connected(Connection(sender))).await;
2826

2927
(websocket.fuse(), receiver)
3028
}
3129
Err(_) => {
3230
tokio::time::sleep(tokio::time::Duration::from_secs(1))
3331
.await;
3432

35-
let _ = output.send(Event::Disconnected).await;
36-
33+
output.send(Event::Disconnected).await;
3734
continue;
3835
}
3936
};
@@ -43,21 +40,20 @@ pub fn connect() -> impl Sipper<Never, Event> {
4340
received = websocket.select_next_some() => {
4441
match received {
4542
Ok(tungstenite::Message::Text(message)) => {
46-
let _ = output.send(Event::MessageReceived(Message::User(message))).await;
43+
output.send(Event::MessageReceived(Message::User(message))).await;
4744
}
4845
Err(_) => {
49-
let _ = output.send(Event::Disconnected).await;
46+
output.send(Event::Disconnected).await;
5047
break;
5148
}
52-
Ok(_) => continue,
49+
Ok(_) => {},
5350
}
5451
}
55-
5652
message = input.select_next_some() => {
5753
let result = websocket.send(tungstenite::Message::Text(message.to_string())).await;
5854

5955
if result.is_err() {
60-
let _ = output.send(Event::Disconnected).await;
56+
output.send(Event::Disconnected).await;
6157
}
6258
}
6359
}

0 commit comments

Comments
 (0)