From 3b55bc428c542f2d4f8f1aa877ae43ea93795be1 Mon Sep 17 00:00:00 2001 From: lukas0008 Date: Tue, 20 Aug 2024 00:11:08 +0200 Subject: [PATCH] Fix: make PacketEncoder work again --- pumpkin-protocol/src/packet_encoder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pumpkin-protocol/src/packet_encoder.rs b/pumpkin-protocol/src/packet_encoder.rs index f970a2eb..1c545804 100644 --- a/pumpkin-protocol/src/packet_encoder.rs +++ b/pumpkin-protocol/src/packet_encoder.rs @@ -83,10 +83,10 @@ impl PacketEncoder { self.buf .copy_within(start_len..start_len + data_len, start_len + data_prefix_len); - let front = &mut self.buf[start_len..]; + let mut front = &mut self.buf[start_len..]; VarInt(packet_len as i32) - .encode(front.as_mut()) + .encode(&mut front) .map_err(|_| PacketError::EncodeLength)?; // Zero for no compression on this packet. VarInt(0)