From bef2e1b9f007df81e9bd42a94c56699273c0dd82 Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Sun, 23 Mar 2025 10:27:38 +0100 Subject: rtic-sync: remove unnecessary with_mut, safety comment --- rtic-sync/src/channel.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rtic-sync/src/channel.rs') diff --git a/rtic-sync/src/channel.rs b/rtic-sync/src/channel.rs index b2792a2..043d058 100644 --- a/rtic-sync/src/channel.rs +++ b/rtic-sync/src/channel.rs @@ -57,10 +57,10 @@ macro_rules! cs_access { where F: FnOnce(&mut $type) -> R, { - self.$name.with_mut(|v| { - let v = unsafe { &mut *v }; - f(v) - }) + let v = self.$name.get_mut(); + // SAFETY: we have exclusive access due to the critical section. + let v = unsafe { v.deref() }; + f(v) } }; } -- cgit v1.2.3