From f7fa7bfa467e5c0b09b7bbd526297b4a2a7ca088 Mon Sep 17 00:00:00 2001 From: Alexander Medvedev Date: Tue, 17 Dec 2024 00:27:21 +0100 Subject: [PATCH] fix: clippy test failing -_- --- pumpkin-protocol/src/packet_encoder.rs | 30 +++++++++++--------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/pumpkin-protocol/src/packet_encoder.rs b/pumpkin-protocol/src/packet_encoder.rs index 4b0bb198..a329ee08 100644 --- a/pumpkin-protocol/src/packet_encoder.rs +++ b/pumpkin-protocol/src/packet_encoder.rs @@ -42,33 +42,29 @@ impl PacketEncoder { /// The packet format is as follows: /// /// **Uncompressed:** - /// ``` - /// +-----------------------+ + /// |-----------------------| /// | Packet Length (VarInt)| - /// +-----------------------+ + /// |-----------------------| /// | Packet ID (VarInt) | - /// +-----------------------+ + /// |-----------------------| /// | Data (Byte Array) | - /// +-----------------------+ - /// ``` + /// |-----------------------| /// /// **Compressed:** - /// ``` - /// +-----------------------+ + /// |------------------------| /// | Packet Length (VarInt) | - /// +-----------------------+ + /// |------------------------| /// | Data Length (VarInt) | - /// +-----------------------+ + /// |------------------------| /// | Packet ID (VarInt) | - /// +-----------------------+ + /// |------------------------| /// | Data (Byte Array) | - /// +-----------------------+ + /// |------------------------| /// - /// * `Packet Length`: The total length of the packet *excluding* the `Packet Length` field itself. - /// * `Data Length`: (Only present in compressed packets) The length of the uncompressed `Packet ID` and `Data`. - /// * `Packet ID`: The ID of the packet. - /// * `Data`: The packet's data. - /// ``` + /// - `Packet Length`: The total length of the packet *excluding* the `Packet Length` field itself. + /// - `Data Length`: (Only present in compressed packets) The length of the uncompressed `Packet ID` and `Data`. + /// - `Packet ID`: The ID of the packet. + /// - `Data`: The packet's data. pub fn append_packet(&mut self, packet: &P) -> Result<(), PacketEncodeError> { let start_len = self.buf.len(); // Write the Packet ID first