fix: clippy test failing

-_-
This commit is contained in:
Alexander Medvedev 2024-12-17 00:27:21 +01:00
parent c285915d00
commit f7fa7bfa46

View File

@ -42,33 +42,29 @@ impl PacketEncoder {
/// The packet format is as follows: /// The packet format is as follows:
/// ///
/// **Uncompressed:** /// **Uncompressed:**
/// ``` /// |-----------------------|
/// +-----------------------+
/// | Packet Length (VarInt)| /// | Packet Length (VarInt)|
/// +-----------------------+ /// |-----------------------|
/// | Packet ID (VarInt) | /// | Packet ID (VarInt) |
/// +-----------------------+ /// |-----------------------|
/// | Data (Byte Array) | /// | Data (Byte Array) |
/// +-----------------------+ /// |-----------------------|
/// ```
/// ///
/// **Compressed:** /// **Compressed:**
/// ``` /// |------------------------|
/// +-----------------------+
/// | Packet Length (VarInt) | /// | Packet Length (VarInt) |
/// +-----------------------+ /// |------------------------|
/// | Data Length (VarInt) | /// | Data Length (VarInt) |
/// +-----------------------+ /// |------------------------|
/// | Packet ID (VarInt) | /// | Packet ID (VarInt) |
/// +-----------------------+ /// |------------------------|
/// | Data (Byte Array) | /// | Data (Byte Array) |
/// +-----------------------+ /// |------------------------|
/// ///
/// * `Packet Length`: The total length of the packet *excluding* the `Packet Length` field itself. /// - `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`. /// - `Data Length`: (Only present in compressed packets) The length of the uncompressed `Packet ID` and `Data`.
/// * `Packet ID`: The ID of the packet. /// - `Packet ID`: The ID of the packet.
/// * `Data`: The packet's data. /// - `Data`: The packet's data.
/// ```
pub fn append_packet<P: ClientPacket>(&mut self, packet: &P) -> Result<(), PacketEncodeError> { pub fn append_packet<P: ClientPacket>(&mut self, packet: &P) -> Result<(), PacketEncodeError> {
let start_len = self.buf.len(); let start_len = self.buf.len();
// Write the Packet ID first // Write the Packet ID first