PacketQueue::init() does not need to be unsafe
This commit is contained in:
parent
485bb76e46
commit
3c601bf8d2
@ -42,10 +42,12 @@ impl<const TX: usize, const RX: usize> PacketQueue<TX, RX> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Allow to initialize a Self without requiring it to go on the stack
|
// Allow to initialize a Self without requiring it to go on the stack
|
||||||
pub unsafe fn init(this: &mut MaybeUninit<Self>) {
|
pub fn init(this: &mut MaybeUninit<Self>) {
|
||||||
|
unsafe {
|
||||||
this.as_mut_ptr().write_bytes(0u8, core::mem::size_of::<Self>());
|
this.as_mut_ptr().write_bytes(0u8, core::mem::size_of::<Self>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static WAKER: AtomicWaker = AtomicWaker::new();
|
static WAKER: AtomicWaker = AtomicWaker::new();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user