forgot to add a cstor

This commit is contained in:
Numbers
2024-05-20 23:24:35 -04:00
parent 1e71e342be
commit 22b6fb6fc5

View File

@@ -96,6 +96,11 @@ pub struct FixedVec<const MAX_LEN: usize, T> {
}
impl<const MAX_LEN: usize, T: Sized> FixedVec<MAX_LEN, T> {
pub fn new() -> Self {
unsafe { core::mem::zeroed() }
}
pub fn push(&mut self, value: T) -> Option<()> {
if self.length >= MAX_LEN { return None }
unsafe { *self.buffer[self.length].as_mut_ptr() = value };