Skip to content

Commit

Permalink
build: parser: Remove payload_length from payload data
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Oct 4, 2024
1 parent 24993ce commit 0c8cd86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,14 @@ impl MessageDefinition {
PayloadType::CHAR |
PayloadType::U8 |
PayloadType::I8 => quote! {
payload[#b..payload.len()].to_vec()
payload[#b + #length_size..payload.len()].to_vec()
},
PayloadType::U16 |
PayloadType::U32 |
PayloadType::I16 |
PayloadType::I32 |
PayloadType::F32 => quote! {
payload[#b..payload.len()]
payload[#b + #length_size..payload.len()]
.chunks_exact(#data_size)
.into_iter()
.map(|a| u16::from_le_bytes((*a).try_into().expect("Wrong slice length")))
Expand Down

0 comments on commit 0c8cd86

Please sign in to comment.