diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-09-22 16:42:49 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-09-22 16:42:49 +0200 |
| commit | a0487380da42a71ab7532e2bc1befd1039c18a78 (patch) | |
| tree | bb235fc3ba54f31838f3b546f7b4734ee8b42558 /embassy-sync | |
| parent | 897b72c872183221e088611aa6f30989800afd2b (diff) | |
Replace futures::future::poll_fn -> core::future::poll_fn.
Diffstat (limited to 'embassy-sync')
| -rw-r--r-- | embassy-sync/src/mutex.rs | 3 | ||||
| -rw-r--r-- | embassy-sync/src/signal.rs | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/embassy-sync/src/mutex.rs b/embassy-sync/src/mutex.rs index 92101c6b5..fcf056d36 100644 --- a/embassy-sync/src/mutex.rs +++ b/embassy-sync/src/mutex.rs | |||
| @@ -2,11 +2,10 @@ | |||
| 2 | //! | 2 | //! |
| 3 | //! This module provides a mutex that can be used to synchronize data between asynchronous tasks. | 3 | //! This module provides a mutex that can be used to synchronize data between asynchronous tasks. |
| 4 | use core::cell::{RefCell, UnsafeCell}; | 4 | use core::cell::{RefCell, UnsafeCell}; |
| 5 | use core::future::poll_fn; | ||
| 5 | use core::ops::{Deref, DerefMut}; | 6 | use core::ops::{Deref, DerefMut}; |
| 6 | use core::task::Poll; | 7 | use core::task::Poll; |
| 7 | 8 | ||
| 8 | use futures_util::future::poll_fn; | ||
| 9 | |||
| 10 | use crate::blocking_mutex::raw::RawMutex; | 9 | use crate::blocking_mutex::raw::RawMutex; |
| 11 | use crate::blocking_mutex::Mutex as BlockingMutex; | 10 | use crate::blocking_mutex::Mutex as BlockingMutex; |
| 12 | use crate::waitqueue::WakerRegistration; | 11 | use crate::waitqueue::WakerRegistration; |
diff --git a/embassy-sync/src/signal.rs b/embassy-sync/src/signal.rs index 34201d03a..b4d99513a 100644 --- a/embassy-sync/src/signal.rs +++ b/embassy-sync/src/signal.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | //! A synchronization primitive for passing the latest value to a task. | 1 | //! A synchronization primitive for passing the latest value to a task. |
| 2 | use core::cell::UnsafeCell; | 2 | use core::cell::UnsafeCell; |
| 3 | use core::future::Future; | 3 | use core::future::{poll_fn, Future}; |
| 4 | use core::mem; | 4 | use core::mem; |
| 5 | use core::task::{Context, Poll, Waker}; | 5 | use core::task::{Context, Poll, Waker}; |
| 6 | 6 | ||
| @@ -94,7 +94,7 @@ impl<T: Send> Signal<T> { | |||
| 94 | 94 | ||
| 95 | /// Future that completes when this Signal has been signaled. | 95 | /// Future that completes when this Signal has been signaled. |
| 96 | pub fn wait(&self) -> impl Future<Output = T> + '_ { | 96 | pub fn wait(&self) -> impl Future<Output = T> + '_ { |
| 97 | futures_util::future::poll_fn(move |cx| self.poll_wait(cx)) | 97 | poll_fn(move |cx| self.poll_wait(cx)) |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | /// non-blocking method to check whether this signal has been signaled. | 100 | /// non-blocking method to check whether this signal has been signaled. |
