From 11352fc0adb542d24240a34026f6cbc6f33e442a Mon Sep 17 00:00:00 2001 From: Intege-rs Date: Fri, 11 Apr 2025 10:29:16 -0400 Subject: [PATCH] fix zero_and_clear --- sub/core/src/arrays.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sub/core/src/arrays.rs b/sub/core/src/arrays.rs index a08c156..ce6f66c 100644 --- a/sub/core/src/arrays.rs +++ b/sub/core/src/arrays.rs @@ -57,17 +57,20 @@ 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; } } +impl FixedVec { + pub fn zero_and_clear(&mut self) { + self.as_slice_mut().fill(0); + self.length = 0; + } +} + + impl Debug for FixedVec { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { Debug::fmt(self.as_slice(), f)