mailformed -> malformed

This commit is contained in:
StripedMonkey 2024-08-20 20:02:09 -04:00
parent 7c30391e2c
commit f56b566afb
2 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@ pub enum PacketError {
#[error("packet length is out of bounds")] #[error("packet length is out of bounds")]
OutOfBounds, OutOfBounds,
#[error("malformed packet length VarInt")] #[error("malformed packet length VarInt")]
MailformedLength, MalformedLength,
} }
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]

View File

@ -28,7 +28,7 @@ impl PacketDecoder {
let packet_len = match VarInt::decode_partial(&mut r) { let packet_len = match VarInt::decode_partial(&mut r) {
Ok(len) => len, Ok(len) => len,
Err(VarIntDecodeError::Incomplete) => return Ok(None), Err(VarIntDecodeError::Incomplete) => return Ok(None),
Err(VarIntDecodeError::TooLarge) => Err(PacketError::MailformedLength)?, Err(VarIntDecodeError::TooLarge) => Err(PacketError::MalformedLength)?,
}; };
if !(0..=MAX_PACKET_SIZE).contains(&packet_len) { if !(0..=MAX_PACKET_SIZE).contains(&packet_len) {