@@ -252,7 +252,7 @@ pub(crate) fn dlt_standard_header(input: &[u8]) -> IResult<&[u8], StandardHeader
252
252
Ok ( (
253
253
input,
254
254
StandardHeader :: new (
255
- header_type_byte >> 5 & 0b111 ,
255
+ ( header_type_byte >> 5 ) & 0b111 ,
256
256
if ( header_type_byte & BIG_ENDIAN_FLAG ) != 0 {
257
257
Endianness :: Big
258
258
} else {
@@ -729,10 +729,10 @@ fn dlt_payload<T: NomByteOrder>(
729
729
Err ( e) => Err ( e) ,
730
730
}
731
731
} else {
732
- if input . len ( ) < 4 {
732
+ if payload_length < 4 {
733
733
return Err ( nom:: Err :: Failure ( DltParseError :: ParsingHickup ( format ! (
734
734
"error, payload too short {}" ,
735
- input . len ( )
735
+ payload_length
736
736
) ) ) ) ;
737
737
}
738
738
match tuple ( ( T :: parse_u32, take ( payload_length - 4 ) ) ) ( input) {
@@ -1002,6 +1002,7 @@ pub(crate) fn skip_till_after_next_storage_header(
1002
1002
}
1003
1003
}
1004
1004
1005
+ #[ allow( clippy:: useless_conversion) ]
1005
1006
/// Remove the storage header from the input if present
1006
1007
pub fn skip_storage_header ( input : & [ u8 ] ) -> Result < ( & [ u8 ] , u64 ) , DltParseError > {
1007
1008
let ( i, ( _, _, _) ) : ( & [ u8 ] , _ ) = tuple ( ( tag ( "DLT" ) , tag ( & [ 0x01 ] ) , take ( 12usize ) ) ) ( input)
@@ -1015,6 +1016,7 @@ pub fn skip_storage_header(input: &[u8]) -> Result<(&[u8], u64), DltParseError>
1015
1016
}
1016
1017
}
1017
1018
1019
+ #[ allow( clippy:: useless_conversion) ]
1018
1020
/// Skip one dlt message in the input stream in an efficient way
1019
1021
/// pre: message to be parsed contains a storage header
1020
1022
pub fn dlt_consume_msg ( input : & [ u8 ] ) -> Result < ( & [ u8 ] , Option < u64 > ) , DltParseError > {
0 commit comments