mirror of
https://github.com/actix/examples
synced 2025-06-28 09:50:36 +02:00
cleanup and cargo fmt
This commit is contained in:
@ -83,9 +83,7 @@ impl Actor for WsChatSession {
|
||||
|
||||
fn stopping(&mut self, ctx: &mut Self::Context) -> Running {
|
||||
// notify chat server
|
||||
ctx.state()
|
||||
.addr
|
||||
.do_send(server::Disconnect { id: self.id });
|
||||
ctx.state().addr.do_send(server::Disconnect { id: self.id });
|
||||
Running::Stop
|
||||
}
|
||||
}
|
||||
|
@ -114,10 +114,7 @@ impl Handler<Connect> for ChatServer {
|
||||
self.sessions.insert(id, msg.addr);
|
||||
|
||||
// auto join session to Main room
|
||||
self.rooms
|
||||
.get_mut(&"Main".to_owned())
|
||||
.unwrap()
|
||||
.insert(id);
|
||||
self.rooms.get_mut(&"Main".to_owned()).unwrap().insert(id);
|
||||
|
||||
// send id back
|
||||
id
|
||||
|
Reference in New Issue
Block a user