add zero and clear
This commit is contained in:
@@ -57,6 +57,11 @@ impl<const MAX_LEN: usize, T: Sized> FixedVec<MAX_LEN, T> {
|
|||||||
unsafe { core::slice::from_raw_parts_mut(self.buffer.as_mut_ptr() as *mut T, self.length) }
|
unsafe { core::slice::from_raw_parts_mut(self.buffer.as_mut_ptr() as *mut T, self.length) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn zero_and_clear(&mut self) {
|
||||||
|
self.as_slice_mut().fill(0);
|
||||||
|
self.length = 0;
|
||||||
|
}
|
||||||
|
|
||||||
pub fn clear(&mut self) {
|
pub fn clear(&mut self) {
|
||||||
self.length = 0;
|
self.length = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user