Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowiiii committed Jan 2, 2025
1 parent fa07af7 commit 2767eff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pumpkin-protocol/src/packet_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions pumpkin-protocol/src/packet_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2767eff

Please sign in to comment.