mirror of
https://github.com/async-rs/async-std.git
synced 2025-01-16 10:49:55 +00:00
feat: Make the future module no_std
This commit is contained in:
parent
6aa55fde59
commit
1762de285b
3 changed files with 17 additions and 12 deletions
|
@ -21,8 +21,8 @@ cfg_unstable_default! {
|
|||
}
|
||||
|
||||
extension_trait! {
|
||||
use std::pin::Pin;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use core::pin::Pin;
|
||||
use core::ops::{Deref, DerefMut};
|
||||
|
||||
use crate::task::{Context, Poll};
|
||||
|
||||
|
@ -136,7 +136,7 @@ extension_trait! {
|
|||
|
||||
[`Future`]: ../future/trait.Future.html
|
||||
"#]
|
||||
pub trait FutureExt: std::future::Future {
|
||||
pub trait FutureExt: core::future::Future {
|
||||
/// Returns a Future that delays execution for a specified time.
|
||||
///
|
||||
/// # Examples
|
||||
|
|
|
@ -46,15 +46,20 @@
|
|||
//! [`Future::race`]: trait.Future.html#method.race
|
||||
//! [`Future::try_race`]: trait.Future.html#method.try_race
|
||||
|
||||
cfg_no_std! {
|
||||
pub use future::Future;
|
||||
pub(crate) mod future;
|
||||
}
|
||||
|
||||
cfg_std! {
|
||||
pub use pending::pending;
|
||||
pub use poll_fn::poll_fn;
|
||||
pub use ready::ready;
|
||||
|
||||
pub(crate) mod future;
|
||||
mod pending;
|
||||
mod poll_fn;
|
||||
mod ready;
|
||||
}
|
||||
|
||||
cfg_default! {
|
||||
pub use timeout::{timeout, TimeoutError};
|
||||
|
|
|
@ -243,10 +243,10 @@ mod macros;
|
|||
|
||||
cfg_no_std! {
|
||||
pub mod task;
|
||||
pub mod future;
|
||||
}
|
||||
|
||||
cfg_std! {
|
||||
pub mod future;
|
||||
pub mod io;
|
||||
pub mod os;
|
||||
pub mod prelude;
|
||||
|
|
Loading…
Reference in a new issue