zeroed trait
This commit is contained in:
@@ -44,4 +44,9 @@ pub fn distance(p1: impl As<usize>, p2: impl As<usize>) -> usize {
|
|||||||
Ordering::Greater => p1 - p2,
|
Ordering::Greater => p1 - p2,
|
||||||
Ordering::Equal => 0,
|
Ordering::Equal => 0,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait Zeroed: Sized {
|
||||||
|
#[inline(always)]
|
||||||
|
fn zeroed() -> Self { unsafe { core::mem::zeroed() } }
|
||||||
}
|
}
|
||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user