From cd20edd0f5bfe100bfc918eb5513d8948c1ae41f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:46:26 +0000 Subject: [PATCH] fix(deps): update rust crate zerocopy to 0.8.0 --- Cargo.toml | 4 ++-- src/parse.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a552233..db89bc2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,9 +12,9 @@ license = "MIT" [dependencies] libc = "0.2.155" -utmp-raw = { git = "https://github.com/Unpublished/utmp-rs" } +utmp-raw = { git = "https://github.com/Unpublished/utmp-rs", branch = "dev" } thiserror = "2.0.0" -zerocopy = "0.7.35" +zerocopy = "0.8.0" [dev-dependencies] anyhow = "1.0.86" diff --git a/src/parse.rs b/src/parse.rs index 0796b90..716f8ec 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -7,7 +7,7 @@ use std::mem; use std::path::Path; use thiserror::Error; use utmp_raw::{utmp, x32::utmp as utmp32, x64::utmp as utmp64}; -use zerocopy::{FromBytes, Ref}; +use zerocopy::{FromBytes, Immutable, KnownLayout}; #[doc(hidden)] pub struct UtmpParserImpl(R, PhantomData); @@ -86,7 +86,7 @@ impl Iterator for UtmpParserImpl { } } -fn read_entry( +fn read_entry( mut reader: R, buffer: &mut [u8], ) -> Result, ParseError> { @@ -111,7 +111,7 @@ fn read_entry( Err(e) => return Err(e.into()), } } - Ok(Some(Ref::<_, T>::new(buffer).unwrap().into_ref())) + Ok(Some(T::ref_from_bytes(buffer).unwrap())) } /// Parse utmp entries.