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

@ -17,7 +17,7 @@ mod server;
pub use self::server::{ChatServer, ChatServerHandle};
/// Connection ID.
pub type ConnId = usize;
pub type ConnId = u64;
/// Room ID.
pub type RoomId = String;

View File

@ -9,7 +9,7 @@ use std::{
},
};
use rand::{thread_rng, Rng as _};
use rand::Rng as _;
use tokio::sync::{mpsc, oneshot};
use crate::{ConnId, Msg, RoomId};
@ -124,7 +124,7 @@ impl ChatServer {
self.send_system_message("main", 0, "Someone joined").await;
// register session with random connection ID
let id = thread_rng().gen::<ConnId>();
let id = rand::rng().random::<ConnId>();
self.sessions.insert(id, tx);
// auto join session to main room