diff options
| author | Dániel Buga <[email protected]> | 2024-12-30 12:13:13 +0100 |
|---|---|---|
| committer | Dániel Buga <[email protected]> | 2024-12-30 12:13:13 +0100 |
| commit | 44217aa0924e7590aa0afabdf17babd5c2ea5b82 (patch) | |
| tree | e42f5d02f9b560610b870d802cf390518180c3c6 /embassy-net-nrf91/src | |
| parent | a4f8fddd696ca2e3705827ba4b3806cbadcb3134 (diff) | |
Desugar some async fns
Diffstat (limited to 'embassy-net-nrf91/src')
| -rw-r--r-- | embassy-net-nrf91/src/lib.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/embassy-net-nrf91/src/lib.rs b/embassy-net-nrf91/src/lib.rs index 3abe2c766..61fcaea1f 100644 --- a/embassy-net-nrf91/src/lib.rs +++ b/embassy-net-nrf91/src/lib.rs | |||
| @@ -9,7 +9,7 @@ mod fmt; | |||
| 9 | pub mod context; | 9 | pub mod context; |
| 10 | 10 | ||
| 11 | use core::cell::RefCell; | 11 | use core::cell::RefCell; |
| 12 | use core::future::poll_fn; | 12 | use core::future::{poll_fn, Future}; |
| 13 | use core::marker::PhantomData; | 13 | use core::marker::PhantomData; |
| 14 | use core::mem::{self, MaybeUninit}; | 14 | use core::mem::{self, MaybeUninit}; |
| 15 | use core::ptr::{self, addr_of, addr_of_mut, copy_nonoverlapping}; | 15 | use core::ptr::{self, addr_of, addr_of_mut, copy_nonoverlapping}; |
| @@ -737,7 +737,7 @@ pub struct Control<'a> { | |||
| 737 | 737 | ||
| 738 | impl<'a> Control<'a> { | 738 | impl<'a> Control<'a> { |
| 739 | /// Wait for modem IPC to be initialized. | 739 | /// Wait for modem IPC to be initialized. |
| 740 | pub async fn wait_init(&self) { | 740 | pub fn wait_init(&self) -> impl Future<Output = ()> + '_ { |
| 741 | poll_fn(|cx| { | 741 | poll_fn(|cx| { |
| 742 | let mut state = self.state.borrow_mut(); | 742 | let mut state = self.state.borrow_mut(); |
| 743 | if state.init { | 743 | if state.init { |
| @@ -746,7 +746,6 @@ impl<'a> Control<'a> { | |||
| 746 | state.init_waker.register(cx.waker()); | 746 | state.init_waker.register(cx.waker()); |
| 747 | Poll::Pending | 747 | Poll::Pending |
| 748 | }) | 748 | }) |
| 749 | .await | ||
| 750 | } | 749 | } |
| 751 | 750 | ||
| 752 | async fn request(&self, msg: &mut Message, req_data: &[u8], resp_data: &mut [u8]) -> usize { | 751 | async fn request(&self, msg: &mut Message, req_data: &[u8], resp_data: &mut [u8]) -> usize { |
