mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-21 07:03:56 +02:00
Address code review comments
This commit is contained in:
parent
2d04ba0508
commit
afa524c18c
3 changed files with 16 additions and 33 deletions
|
@ -35,6 +35,11 @@ pub enum ReportData {
|
|||
}
|
||||
|
||||
fn report_data_to_bytes(data: &[u8], version: u8) -> [u8; REPORT_DATA_LENGTH] {
|
||||
debug_assert!(
|
||||
data.len() < REPORT_DATA_LENGTH, // Ensure there is space for the version byte
|
||||
"Data length exceeds maximum of {} bytes",
|
||||
REPORT_DATA_LENGTH
|
||||
);
|
||||
let mut bytes = [0u8; REPORT_DATA_LENGTH];
|
||||
bytes[..data.len()].copy_from_slice(data);
|
||||
bytes[REPORT_DATA_LENGTH - 1] = version;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue