Assert STORE_PATH_HASH_SIZE matches C struct
`zerocopy` is safe enough, but it's good to be explicit about this.
This commit is contained in:
parent
65abededca
commit
6619b881b3
1 changed files with 3 additions and 0 deletions
|
|
@ -12,6 +12,9 @@ use nix_bindings_util::{
|
||||||
/// The size of a store path hash in bytes (20 bytes, decoded from nix32).
|
/// The size of a store path hash in bytes (20 bytes, decoded from nix32).
|
||||||
pub const STORE_PATH_HASH_SIZE: usize = 20;
|
pub const STORE_PATH_HASH_SIZE: usize = 20;
|
||||||
|
|
||||||
|
#[cfg(nix_at_least = "2.33")]
|
||||||
|
const _: () = assert!(std::mem::size_of::<raw::store_path_hash_part>() == STORE_PATH_HASH_SIZE);
|
||||||
|
|
||||||
pub struct StorePath {
|
pub struct StorePath {
|
||||||
raw: NonNull<raw::StorePath>,
|
raw: NonNull<raw::StorePath>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue