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

@@ -45,3 +45,8 @@ pub fn distance(p1: impl As<usize>, p2: impl As<usize>) -> usize {
Ordering::Equal => 0, 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, slicify_mut,
statify, statify,
statify_mut, statify_mut,
Zeroed
}; };
pub use crate::arrays::{ pub use crate::arrays::{
fill_with, fill_with,