From 840f269845bf397816525186b85e16a22f6bbe6c Mon Sep 17 00:00:00 2001 From: nothendev Date: Sun, 8 Oct 2023 14:46:32 +0300 Subject: [PATCH] more unsafe ??!??? --- protocol/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/src/lib.rs b/protocol/src/lib.rs index 069b0dd..82c7f28 100644 --- a/protocol/src/lib.rs +++ b/protocol/src/lib.rs @@ -238,7 +238,7 @@ impl PlayerNet { }; trace!(?buf, ?spack, "recving packet"); s_recv.send_async(spack).await?; - buf.fill(0); + unsafe { std::ptr::write_bytes(buf.as_mut().as_mut_ptr(), 0u8, buf.len()) }; } } .await?;