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::Equal => 0,
|
||||
}
|
||||
}
|
||||
|
||||
pub trait Zeroed: Sized {
|
||||
#[inline(always)]
|
||||
fn zeroed() -> Self { unsafe { core::mem::zeroed() } }
|
||||
}
|
||||
Reference in New Issue
Block a user