diff --git a/embassy/src/util/mutex.rs b/embassy/src/util/mutex.rs index db3423cb..c8fe8402 100644 --- a/embassy/src/util/mutex.rs +++ b/embassy/src/util/mutex.rs @@ -108,20 +108,18 @@ pub fn in_thread_mode() -> bool { /// A "mutex" that does nothing and cannot be shared between threads. pub struct NoopMutex { - inner: UnsafeCell, + inner: T, } impl NoopMutex { pub const fn new(value: T) -> Self { - NoopMutex { - inner: UnsafeCell::new(value), - } + NoopMutex { inner: value } } } impl NoopMutex { pub fn borrow(&self) -> &T { - unsafe { &*self.inner.get() } + &self.inner } }