Proper signature management

This commit is contained in:
2026-08-11 23:43:56 -04:00
parent aacb11bc01
commit 019c2888cb
6 changed files with 80 additions and 11 deletions
+4 -2
View File
@@ -24,8 +24,10 @@ impl Server {
impl Server {
pub async fn ws_handler(self: &Arc<Self>, ws: WebSocketUpgrade) -> Response {
ws.on_upgrade(|socket: WebSocket| async {
match Client::initialize(socket).await {
let s = self.clone();
ws.on_upgrade(move |socket: WebSocket| async move {
match Client::initialize(&s, socket).await {
Ok(mut client) => {
if let Err(e) = client.read_loop().await {
eprintln!("Failed to handle client: {e}");