aboutsummaryrefslogtreecommitdiff
path: root/embassy-sync/src/watch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-sync/src/watch.rs')
-rw-r--r--embassy-sync/src/watch.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-sync/src/watch.rs b/embassy-sync/src/watch.rs
index 404e31714..e76646c0b 100644
--- a/embassy-sync/src/watch.rs
+++ b/embassy-sync/src/watch.rs
@@ -1,7 +1,7 @@
1//! A synchronization primitive for passing the latest value to **multiple** receivers. 1//! A synchronization primitive for passing the latest value to **multiple** receivers.
2 2
3use core::cell::RefCell; 3use core::cell::RefCell;
4use core::future::poll_fn; 4use core::future::{poll_fn, Future};
5use core::marker::PhantomData; 5use core::marker::PhantomData;
6use core::ops::{Deref, DerefMut}; 6use core::ops::{Deref, DerefMut};
7use core::task::{Context, Poll}; 7use core::task::{Context, Poll};
@@ -547,8 +547,8 @@ impl<'a, T: Clone, W: WatchBehavior<T> + ?Sized> Rcv<'a, T, W> {
547 /// Returns the current value of the `Watch` once it is initialized, marking it as seen. 547 /// Returns the current value of the `Watch` once it is initialized, marking it as seen.
548 /// 548 ///
549 /// **Note**: Futures do nothing unless you `.await` or poll them. 549 /// **Note**: Futures do nothing unless you `.await` or poll them.
550 pub async fn get(&mut self) -> T { 550 pub fn get(&mut self) -> impl Future<Output = T> + '_ {
551 poll_fn(|cx| self.watch.poll_get(&mut self.at_id, cx)).await 551 poll_fn(|cx| self.watch.poll_get(&mut self.at_id, cx))
552 } 552 }
553 553
554 /// Tries to get the current value of the `Watch` without waiting, marking it as seen. 554 /// Tries to get the current value of the `Watch` without waiting, marking it as seen.