diff --git a/pumpkin-protocol/src/packet_decoder.rs b/pumpkin-protocol/src/packet_decoder.rs index 7c38b538..43beb6ad 100644 --- a/pumpkin-protocol/src/packet_decoder.rs +++ b/pumpkin-protocol/src/packet_decoder.rs @@ -451,7 +451,7 @@ mod tests { // Sample packet data: packet_id = 8, payload = "A" repeated MAX_PACKET_SIZE times // Sample packet data: packet_id = 8, payload = "A" repeated (MAX_PACKET_SIZE - 1) times let packet_id = 8; - let payload = vec![0x41u8; (MAX_PACKET_SIZE - 1) as usize]; // "A" repeated + let payload = vec![0x41u8; MAX_PACKET_SIZE - 1]; // "A" repeated // Build the packet with compression enabled let packet = build_packet(packet_id, &payload, true, None, None); diff --git a/pumpkin-protocol/src/packet_encoder.rs b/pumpkin-protocol/src/packet_encoder.rs index 04d1fa5b..4e7a49bd 100644 --- a/pumpkin-protocol/src/packet_encoder.rs +++ b/pumpkin-protocol/src/packet_encoder.rs @@ -511,7 +511,7 @@ mod tests { // Verify that the packet size does not exceed MAX_PACKET_SIZE assert!( - packet_bytes.len() <= MAX_PACKET_SIZE as usize, + packet_bytes.len() <= MAX_PACKET_SIZE, "Packet size exceeds maximum allowed size" ); @@ -543,7 +543,7 @@ mod tests { #[should_panic(expected = "TooLong")] fn test_encode_packet_exceeding_maximum_size() { // Create a custom packet with data exceeding MAX_PACKET_SIZE - let data_size = MAX_PACKET_SIZE as usize + 1; // Exceed by 1 byte + let data_size = MAX_PACKET_SIZE + 1; // Exceed by 1 byte let packet = MaxSizePacket::new(data_size); // Build the packet without compression and encryption