1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00

chore: update deps

This commit is contained in:
Rob Ede
2025-02-24 03:28:41 +00:00
parent ad0c1b765e
commit a6df6cc903
6 changed files with 464 additions and 447 deletions

View File

@ -59,7 +59,6 @@ pub struct Join {
pub struct ChatServer {
sessions: HashMap<usize, Recipient<session::Message>>,
rooms: HashMap<String, HashSet<usize>>,
rng: ThreadRng,
}
impl Default for ChatServer {
@ -71,7 +70,6 @@ impl Default for ChatServer {
ChatServer {
sessions: HashMap::new(),
rooms,
rng: rand::thread_rng(),
}
}
}
@ -111,7 +109,7 @@ impl Handler<Connect> for ChatServer {
self.send_message("main", "Someone joined", 0);
// register session with random id
let id = self.rng.gen::<usize>();
let id = rand::rng().random::<usize>();
self.sessions.insert(id, msg.addr);
// auto join session to main room