From 04eaa5c3d01a8f3a599a3a1abf7205eed80df4a2 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 Dec 2024 06:16:10 +0000 Subject: remove dependency on bytes crate for azalea-protocol and fix memory leak --- azalea-protocol/src/write.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'azalea-protocol/src/write.rs') diff --git a/azalea-protocol/src/write.rs b/azalea-protocol/src/write.rs index 512d08ad..f1ffd82e 100755 --- a/azalea-protocol/src/write.rs +++ b/azalea-protocol/src/write.rs @@ -31,7 +31,7 @@ where pub fn serialize_packet( packet: &P, -) -> Result, PacketEncodeError> { +) -> Result, PacketEncodeError> { let mut buf = Vec::new(); packet.id().azalea_write_var(&mut buf)?; packet.write(&mut buf)?; @@ -42,7 +42,7 @@ pub fn serialize_packet( packet_string: format!("{packet:?}"), }); } - Ok(buf) + Ok(buf.into_boxed_slice()) } pub async fn write_raw_packet( -- cgit v1.2.3