mirror of
https://github.com/Lokathor/bytemuck.git
synced 2024-11-25 00:02:22 +00:00
Add zeroed_slice_box
This commit is contained in:
parent
4e06e7903b
commit
51f1121d4f
@ -110,6 +110,11 @@ pub fn try_zeroed_slice_box<T: Pod>(length: usize) -> Result<Box<[T]>, ()> {
|
||||
}
|
||||
}
|
||||
|
||||
/// As [`try_zeroed_slice_box`](try_zeroed_slice_box), but unwraps for you.
|
||||
pub fn zeroed_slice_box<T: Pod>(length: usize) -> Result<Box<[T]>, ()> {
|
||||
try_zeroed_slice_box(length).unwrap()
|
||||
}
|
||||
|
||||
/// As [`try_cast_vec`](try_cast_vec), but unwraps for you.
|
||||
#[inline]
|
||||
pub fn cast_vec<A: Pod, B: Pod>(input: Vec<A>) -> Vec<B> {
|
||||
|
Loading…
Reference in New Issue
Block a user