From f7474e6c2204d6ed923a9d9a988ae67d6d4e5449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Tue, 16 Apr 2024 22:59:33 +0200 Subject: [PATCH] singleton: use MaybeUninit::write --- cortex-m/src/macros.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cortex-m/src/macros.rs b/cortex-m/src/macros.rs index 9e8f2552..ba780481 100644 --- a/cortex-m/src/macros.rs +++ b/cortex-m/src/macros.rs @@ -83,8 +83,7 @@ macro_rules! singleton { #[allow(unsafe_code)] unsafe { $name.1 = true; - $name.0 = ::core::mem::MaybeUninit::new(expr); - Some($name.0.assume_init_mut()) + Some($name.0.write(expr)) } } })