Skip to content

Commit

Permalink
fix async FnOnce
Browse files Browse the repository at this point in the history
  • Loading branch information
dankmeme01 committed Dec 7, 2024
1 parent 457323e commit 53c59de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/game/src/client/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -54,7 +54,7 @@ impl ClientSocket {
udp_peer: None,
crypto_box: OnceLock::new(),
game_server,
mtu
mtu,
}
}

Expand All @@ -73,7 +73,7 @@ impl ClientSocket {
#[inline]
pub async fn recv_and_handle<F>(&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));
Expand Down Expand Up @@ -346,7 +346,7 @@ impl ClientSocket {
// send leftover data
Ok(Some(data[written..data.len()].to_vec()))
}
},
}
}
})
};
Expand Down

0 comments on commit 53c59de

Please sign in to comment.