fix parsing errors in sml

This commit is contained in:
Paul Zinselmeyer 2024-05-03 17:42:40 +02:00
parent e9018111be
commit d5126a6c34
Signed by: pfzetto
GPG key ID: B471A1AF06C895FD
2 changed files with 2 additions and 2 deletions

View file

@ -33,7 +33,7 @@ mod can {
} }
let total = u32::from_be_bytes([data[0], data[1], data[2], data[3]]); let total = u32::from_be_bytes([data[0], data[1], data[2], data[3]]);
let current = u32::from_be_bytes([data[4], data[4], data[5], data[6]]); let current = u32::from_be_bytes([data[4], data[5], data[6], data[7]]);
Ok(Self { total, current }) Ok(Self { total, current })
} }

View file

@ -571,7 +571,7 @@ impl<'a> SmlType<'a> for AbortOnError {
where where
Self: Sized, Self: Sized,
{ {
let disc: u8 = buf.read(1)?[0]; let disc: u8 = buf.parse()?;
Ok(match disc { Ok(match disc {
0x00 => Self::Continue, 0x00 => Self::Continue,
0x01 => Self::ContinueWithNextGroup, 0x01 => Self::ContinueWithNextGroup,