mirror of
https://git.intege.rs/xlib/x.git
synced 2025-12-05 20:35:01 +00:00
forgot to add a cstor
This commit is contained in:
@@ -96,6 +96,11 @@ pub struct FixedVec<const MAX_LEN: usize, T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<const MAX_LEN: usize, T: Sized> FixedVec<MAX_LEN, 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<()> {
|
pub fn push(&mut self, value: T) -> Option<()> {
|
||||||
if self.length >= MAX_LEN { return None }
|
if self.length >= MAX_LEN { return None }
|
||||||
unsafe { *self.buffer[self.length].as_mut_ptr() = value };
|
unsafe { *self.buffer[self.length].as_mut_ptr() = value };
|
||||||
|
|||||||
Reference in New Issue
Block a user