Skip to content

Commit

Permalink
fix: clippy test failing
Browse files Browse the repository at this point in the history
-_-
  • Loading branch information
Snowiiii committed Dec 16, 2024
1 parent c285915 commit f7fa7bf
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions pumpkin-protocol/src/packet_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<P: ClientPacket>(&mut self, packet: &P) -> Result<(), PacketEncodeError> {
let start_len = self.buf.len();
// Write the Packet ID first
Expand Down

0 comments on commit f7fa7bf

Please sign in to comment.