diff --git a/sub/core/src/arrays.rs b/sub/core/src/arrays.rs index 9eb7877..a08c156 100644 --- a/sub/core/src/arrays.rs +++ b/sub/core/src/arrays.rs @@ -57,6 +57,11 @@ impl FixedVec { 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; }