Skip to content

Commit

Permalink
feat: upgrade zerocopy to 0.8
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Oct 13, 2024
1 parent c5ecc4a commit e39d215
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ rustdoc-args = ["--cfg", "docsrs"]
bitflags = { version = "2", optional = true }
bytemuck = { version = "1", optional = true }
bytemuck_derive = { version = "1", optional = true }
zerocopy = { version = "0.7", optional = true, default-features = false }
zerocopy-derive = { version = "0.7", optional = true }
zerocopy = { version = "0.8", optional = true, default-features = false }
zerocopy-derive = { version = "0.8", optional = true }

[features]
bitflags = ["dep:bitflags"]
Expand Down
17 changes: 10 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,18 @@
//! - [`bitflags`] — `Be` and `Le` implement [`Bits`], [`ParseHex`], and [`WriteHex`].
//! - [`bytemuck`] — `Be` and `Le` implement [`Zeroable`] and [`Pod`].
//! - `linux-types` — Type aliases like in [`linux/types.h`], such as [`le32`].
//! - [`zerocopy`] — `Be` and `Le` implement [`FromZeroes`], [`FromBytes`], and [`AsBytes`].
//! - [`zerocopy`] — `Be` and `Le` implement [`KnownLayout`], [`Immutable`], [`FromBytes`], and [`IntoBytes`].
//!
//! [`Bits`]: bitflags::Bits
//! [`ParseHex`]: bitflags::parser::ParseHex
//! [`WriteHex`]: bitflags::parser::WriteHex
//! [`Zeroable`]: bytemuck::Zeroable
//! [`Pod`]: bytemuck::Pod
//! [`linux/types.h`]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/types.h?h=v6.9#n36
//! [`FromZeroes`]: zerocopy::FromZeroes
//! [`KnownLayout`]: zerocopy::KnownLayout
//! [`Immutable`]: zerocopy::Immutable
//! [`FromBytes`]: zerocopy::FromBytes
//! [`AsBytes`]: zerocopy::AsBytes
//! [`IntoBytes`]: zerocopy::IntoBytes
//!
//! # Related crates
//!
Expand Down Expand Up @@ -118,9 +119,10 @@ use core::{fmt, mem};
#[cfg_attr(
feature = "zerocopy",
derive(
zerocopy_derive::FromZeroes,
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
zerocopy_derive::AsBytes
zerocopy_derive::IntoBytes,
)
)]
#[derive(Default, Hash, PartialEq, Eq, Clone, Copy)]
Expand Down Expand Up @@ -149,9 +151,10 @@ pub struct Be<T>(pub T);
#[cfg_attr(
feature = "zerocopy",
derive(
zerocopy_derive::FromZeroes,
zerocopy_derive::KnownLayout,
zerocopy_derive::Immutable,
zerocopy_derive::FromBytes,
zerocopy_derive::AsBytes
zerocopy_derive::IntoBytes,
)
)]
#[derive(Default, Hash, PartialEq, Eq, Clone, Copy)]
Expand Down

0 comments on commit e39d215

Please sign in to comment.