From 53c59de69d9a719457427feef9a7a130089cf9fa Mon Sep 17 00:00:00 2001 From: dankmeme01 <42031238+dankmeme01@users.noreply.github.com> Date: Sat, 7 Dec 2024 16:48:53 +0100 Subject: [PATCH] fix async FnOnce --- server/game/src/client/socket.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/game/src/client/socket.rs b/server/game/src/client/socket.rs index 829f6cf4..0a18ce19 100644 --- a/server/game/src/client/socket.rs +++ b/server/game/src/client/socket.rs @@ -14,8 +14,8 @@ use globed_shared::rand::Rng; #[allow(unused_imports)] use globed_shared::{ crypto_box::{ - aead::{AeadCore, AeadInPlace, OsRng}, ChaChaBox, + aead::{AeadCore, AeadInPlace, OsRng}, }, trace, }; @@ -54,7 +54,7 @@ impl ClientSocket { udp_peer: None, crypto_box: OnceLock::new(), game_server, - mtu + mtu, } } @@ -73,7 +73,7 @@ impl ClientSocket { #[inline] pub async fn recv_and_handle(&mut self, bytes: usize, f: F) -> Result<()> where - F: async FnOnce(&mut [u8]) -> Result<()>, + F: AsyncFnOnce(&mut [u8]) -> Result<()>, { if bytes > MAX_PACKET_SIZE { return Err(PacketHandlingError::PacketTooLong(bytes)); @@ -346,7 +346,7 @@ impl ClientSocket { // send leftover data Ok(Some(data[written..data.len()].to_vec())) } - }, + } } }) };