1
0
mirror of https://github.com/actix/examples synced 2024-11-23 14:31:07 +01:00
This commit is contained in:
Rob Ede 2022-07-21 03:30:58 +01:00
parent c557986915
commit 522e3d11e2
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933

View File

@ -112,7 +112,7 @@ impl ChatServer {
.iter()
.find_map(|(room, participants)| participants.contains(&conn).then_some(room))
{
self.send_system_message(&room, conn, msg).await;
self.send_system_message(room, conn, msg).await;
};
}
@ -195,12 +195,7 @@ impl ChatServer {
}
pub async fn run(mut self) -> io::Result<()> {
loop {
let cmd = match self.cmd_rx.recv().await {
Some(cmd) => cmd,
None => break,
};
while let Some(cmd) = self.cmd_rx.recv().await {
match cmd {
Command::Connect { conn_tx, res_tx } => {
let conn_id = self.connect(conn_tx).await;