diff --git a/embassy-futures/src/join.rs b/embassy-futures/src/join.rs index 39a78ccd..7600d4b8 100644 --- a/embassy-futures/src/join.rs +++ b/embassy-futures/src/join.rs @@ -1,3 +1,5 @@ +//! Wait for multiple futures to complete. + use core::future::Future; use core::pin::Pin; use core::task::{Context, Poll}; @@ -131,7 +133,7 @@ generate! { /// /// let a = async { 1 }; /// let b = async { 2 }; -/// let pair = embassy_futures::join(a, b).await; +/// let pair = embassy_futures::join::join(a, b).await; /// /// assert_eq!(pair, (1, 2)); /// # }); @@ -160,7 +162,7 @@ where /// let a = async { 1 }; /// let b = async { 2 }; /// let c = async { 3 }; -/// let res = embassy_futures::join3(a, b, c).await; +/// let res = embassy_futures::join::join3(a, b, c).await; /// /// assert_eq!(res, (1, 2, 3)); /// # }); @@ -191,7 +193,7 @@ where /// let b = async { 2 }; /// let c = async { 3 }; /// let d = async { 4 }; -/// let res = embassy_futures::join4(a, b, c, d).await; +/// let res = embassy_futures::join::join4(a, b, c, d).await; /// /// assert_eq!(res, (1, 2, 3, 4)); /// # }); @@ -229,7 +231,7 @@ where /// let c = async { 3 }; /// let d = async { 4 }; /// let e = async { 5 }; -/// let res = embassy_futures::join5(a, b, c, d, e).await; +/// let res = embassy_futures::join::join5(a, b, c, d, e).await; /// /// assert_eq!(res, (1, 2, 3, 4, 5)); /// # }); diff --git a/embassy-futures/src/lib.rs b/embassy-futures/src/lib.rs index ea135b3a..8c769bdf 100644 --- a/embassy-futures/src/lib.rs +++ b/embassy-futures/src/lib.rs @@ -6,11 +6,10 @@ pub(crate) mod fmt; mod block_on; -mod join; -mod select; mod yield_now; +pub mod join; +pub mod select; + pub use block_on::*; -pub use join::*; -pub use select::*; pub use yield_now::*; diff --git a/embassy-futures/src/select.rs b/embassy-futures/src/select.rs index c0dd7ecd..97a81a86 100644 --- a/embassy-futures/src/select.rs +++ b/embassy-futures/src/select.rs @@ -1,3 +1,5 @@ +//! Wait for the first of several futures to complete. + use core::future::Future; use core::pin::Pin; use core::task::{Context, Poll}; diff --git a/embassy-usb/src/lib.rs b/embassy-usb/src/lib.rs index 5a3f8ba8..b165804e 100644 --- a/embassy-usb/src/lib.rs +++ b/embassy-usb/src/lib.rs @@ -12,7 +12,7 @@ mod descriptor_reader; pub mod driver; pub mod types; -use embassy_futures::{select, Either}; +use embassy_futures::select::{select, Either}; use heapless::Vec; pub use self::builder::{Builder, Config}; diff --git a/examples/nrf/src/bin/usb_hid_keyboard.rs b/examples/nrf/src/bin/usb_hid_keyboard.rs index ba2159c7..7fdb0b68 100644 --- a/examples/nrf/src/bin/usb_hid_keyboard.rs +++ b/examples/nrf/src/bin/usb_hid_keyboard.rs @@ -8,7 +8,7 @@ use core::sync::atomic::{AtomicBool, Ordering}; use defmt::*; use embassy_executor::Spawner; -use embassy_futures::{select, Either}; +use embassy_futures::select::{select, Either}; use embassy_nrf::gpio::{Input, Pin, Pull}; use embassy_nrf::usb::{Driver, PowerUsb}; use embassy_nrf::{interrupt, pac};