PacketQueue::init() does not need to be unsafe
This commit is contained in:
parent
485bb76e46
commit
3c601bf8d2
@ -42,8 +42,10 @@ 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>) {
|
||||||
this.as_mut_ptr().write_bytes(0u8, core::mem::size_of::<Self>());
|
unsafe {
|
||||||
|
this.as_mut_ptr().write_bytes(0u8, core::mem::size_of::<Self>());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user