zeroed trait

This commit is contained in:
Intege-rs
2025-01-04 20:18:34 -05:00
parent 92f8b1d329
commit 1951224107
2 changed files with 6 additions and 0 deletions

View File

@@ -44,4 +44,9 @@ pub fn distance(p1: impl As<usize>, p2: impl As<usize>) -> usize {
Ordering::Greater => p1 - p2,
Ordering::Equal => 0,
}
}
pub trait Zeroed: Sized {
#[inline(always)]
fn zeroed() -> Self { unsafe { core::mem::zeroed() } }
}

View File

@@ -38,6 +38,7 @@ pub mod prelude {
slicify_mut,
statify,
statify_mut,
Zeroed
};
pub use crate::arrays::{
fill_with,