Merge pull request #1254 from davidedellagiustina/fix

FIx `PacketQueue::init()`
This commit is contained in:
Dario Nieuwenhuis 2023-03-01 22:23:03 +01:00 committed by GitHub
commit 206b4b597e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,7 @@ 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 fn init(this: &mut MaybeUninit<Self>) { pub fn init(this: &mut MaybeUninit<Self>) {
unsafe { unsafe {
this.as_mut_ptr().write_bytes(0u8, core::mem::size_of::<Self>()); this.as_mut_ptr().write_bytes(0u8, 1);
} }
} }
} }