From ec9b51833c42ef1ca0d8d6535d17406ec3d6c71b Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Tue, 1 Jun 2021 14:35:52 +0200 Subject: [PATCH] Allow non-mut register and wake --- embassy/src/util/waker_agnostic.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/embassy/src/util/waker_agnostic.rs b/embassy/src/util/waker_agnostic.rs index f43cc8c33..1675c53a0 100644 --- a/embassy/src/util/waker_agnostic.rs +++ b/embassy/src/util/waker_agnostic.rs @@ -61,7 +61,7 @@ impl AtomicWaker { } /// Register a waker. Overwrites the previous waker, if any. - pub fn register(&mut self, w: &Waker) { + pub fn register(&self, w: &Waker) { critical_section::with(|cs| { let cell = self.waker.borrow(cs); cell.set(match cell.replace(None) { @@ -72,7 +72,7 @@ impl AtomicWaker { } /// Wake the registered waker, if any. - pub fn wake(&mut self) { + pub fn wake(&self) { critical_section::with(|cs| { let cell = self.waker.borrow(cs); if let Some(w) = cell.replace(None) {