Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion text/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ edition = "2021"
serde = {version = "1", features = ["derive"]}
ron = "0.8"
tlvc = {path = "../tlvc"}
zerocopy = "0.6"
zerocopy = "0.7"
2 changes: 1 addition & 1 deletion tlvc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
crc = "3.0"
zerocopy = "0.6"
zerocopy = { version = "0.7", features = ["derive"] }
byteorder = {version = "1.4", default-features = false}

[features]
Expand Down
11 changes: 9 additions & 2 deletions tlvc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#![cfg_attr(not(test), no_std)]

use core::mem::size_of;
use zerocopy::{AsBytes, FromBytes};
use zerocopy::{AsBytes, FromBytes, FromZeroes};

/// Shorthand type for little-endian `u32` used in the chunk header.
pub type U32LE = zerocopy::U32<byteorder::LittleEndian>;
Expand All @@ -28,7 +28,14 @@ pub const fn header_checksum(tag: [u8; 4], len: u32) -> u32 {
/// _don't_ require them to be aligned in local memory, so this uses the
/// unaligned and explicitly little-endian version of `u32`.
#[derive(
Copy, Clone, Debug, Default, AsBytes, FromBytes, zerocopy::Unaligned,
Copy,
Clone,
Debug,
Default,
AsBytes,
FromZeroes,
FromBytes,
zerocopy::Unaligned,
)]
#[repr(C)]
pub struct ChunkHeader {
Expand Down