Skip to content

Commit

Permalink
singleton: use MaybeUninit::write
Browse files Browse the repository at this point in the history
  • Loading branch information
jordens committed Apr 16, 2024
1 parent f102430 commit f7474e6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cortex-m/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
})
Expand Down

0 comments on commit f7474e6

Please sign in to comment.