--- a/Cargo.toml +++ b/Cargo.toml @@ -30,5 +30,5 @@ repository = "https://github.com/jadijad version = "1.0.0" [dependencies.zerocopy] -version = "0.7.34" +version = "0.8" features = ["derive"] --- a/src/x32.rs +++ b/src/x32.rs @@ -1,8 +1,8 @@ use super::{cstr_from_bytes, UT_HOSTSIZE, UT_LINESIZE, UT_NAMESIZE}; use std::fmt; -use zerocopy::{FromZeroes, FromBytes}; +use zerocopy::{FromBytes, Immutable, KnownLayout}; -#[derive(FromZeroes, FromBytes, Clone, Copy, Debug)] +#[derive(FromBytes, Immutable, KnownLayout, Clone, Copy, Debug)] #[repr(C)] pub struct timeval { /// Seconds @@ -12,7 +12,7 @@ pub struct timeval { } -#[derive(FromZeroes, Clone, Copy, FromBytes)] +#[derive(Clone, Copy, FromBytes, Immutable, KnownLayout)] #[repr(C)] pub struct utmp { /// Device name of tty - `"/dev/"` --- a/src/x64.rs +++ b/src/x64.rs @@ -1,9 +1,9 @@ use super::{cstr_from_bytes, UT_HOSTSIZE, UT_LINESIZE, UT_NAMESIZE}; use std::fmt; -use zerocopy::{FromZeroes, FromBytes}; +use zerocopy::{FromBytes, Immutable, KnownLayout}; #[repr(C)] -#[derive(Clone, Copy, Debug, FromZeroes, FromBytes)] +#[derive(Clone, Copy, Debug, FromBytes, Immutable, KnownLayout)] pub struct timeval { /// Seconds pub tv_sec: i64, @@ -12,7 +12,7 @@ pub struct timeval { } #[repr(C)] -#[derive(Clone, Copy, FromZeroes, FromBytes)] +#[derive(Clone, Copy, FromBytes, Immutable, KnownLayout)] pub struct utmp { /// Device name of tty - `"/dev/"` pub ut_line: [u8; UT_LINESIZE],