forgot to add a cstor
This commit is contained in:
1 parent
1e71e342be
commit
22b6fb6fc5
1 file changed
+5
@@ -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 };
|
||||
|
||||
Reference in new issue
Block a user