Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@
Ok(payload[0])
}

pub fn parse_i8(payload: &[u8]) -> Result<i8, DecodeError> {
if payload.len() != 1 {
return Err(DecodeError::InvalidNumber {
expected: 1,
received: payload.len(),
});
}
Ok(payload[0] as i8)
}

Check warning on line 99 in src/parsers.rs

View check run for this annotation

Codecov / codecov/patch

src/parsers.rs#L91-L99

Added lines #L91 - L99 were not covered by tests

pub fn parse_u32(payload: &[u8]) -> Result<u32, DecodeError> {
if payload.len() != size_of::<u32>() {
return Err(DecodeError::InvalidNumber {
Expand Down