aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/eth/mod.rs
diff options
context:
space:
mode:
authorDavide Della Giustina <[email protected]>2023-02-28 18:04:43 +0000
committerDavide Della Giustina <[email protected]>2023-02-28 18:04:43 +0000
commit3c601bf8d2624d6fa8fd8e68dfee5cb9348ab4f9 (patch)
tree80810b28acea02456d6ad6db7f8a2704eef7307a /embassy-stm32/src/eth/mod.rs
parent485bb76e467aaa2522907bcb1bad538b4374d672 (diff)
PacketQueue::init() does not need to be unsafe
Diffstat (limited to 'embassy-stm32/src/eth/mod.rs')
-rw-r--r--embassy-stm32/src/eth/mod.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/embassy-stm32/src/eth/mod.rs b/embassy-stm32/src/eth/mod.rs
index 89d2c5a3d..b632861bf 100644
--- a/embassy-stm32/src/eth/mod.rs
+++ b/embassy-stm32/src/eth/mod.rs
@@ -42,8 +42,10 @@ impl<const TX: usize, const RX: usize> PacketQueue<TX, RX> {
42 } 42 }
43 43
44 // Allow to initialize a Self without requiring it to go on the stack 44 // Allow to initialize a Self without requiring it to go on the stack
45 pub unsafe fn init(this: &mut MaybeUninit<Self>) { 45 pub fn init(this: &mut MaybeUninit<Self>) {
46 this.as_mut_ptr().write_bytes(0u8, core::mem::size_of::<Self>()); 46 unsafe {
47 this.as_mut_ptr().write_bytes(0u8, core::mem::size_of::<Self>());
48 }
47 } 49 }
48} 50}
49 51