From 84df6fc6392570693d6fc90a56a192e024f7918a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 4 Oct 2024 17:12:15 -0300 Subject: [PATCH] build: parser: Remove payload_length from payload data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- build/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/parser.rs b/build/parser.rs index 933cf8f5d..5cd220cd3 100644 --- a/build/parser.rs +++ b/build/parser.rs @@ -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")))