async-std/src/future/pending.rs
Yoshua Wuyts 63ad786768
remove async_await feature gate
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-08-21 00:29:35 -07:00

22 lines
467 B
Rust

/// Never resolves to a value.
///
/// # Examples
/// ```
/// # fn main() { async_std::task::block_on(async {
/// #
/// use std::time::Duration;
///
/// use async_std::future::pending;
/// use async_std::io;
///
/// let dur = Duration::from_secs(1);
/// let fut = pending();
///
/// let res: io::Result<()> = io::timeout(dur, fut).await;
/// assert!(res.is_err());
/// #
/// # }) }
/// ```
pub async fn pending<T>() -> T {
futures::future::pending::<T>().await
}