add zero and clear

This commit is contained in:
Intege-rs
2025-04-11 09:47:59 -04:00
parent 6489232e10
commit b19e81862c

View File

@@ -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) }
}
pub fn zero_and_clear(&mut self) {
self.as_slice_mut().fill(0);
self.length = 0;
}
pub fn clear(&mut self) {
self.length = 0;
}