2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-07-08 22:11:35 +00:00
async-std/src/future/ready.rs
2019-08-12 12:50:35 +02:00

21 lines
467 B
Rust

/// Resolves to the provided value.
///
/// This function is an async version of [`std::convert::identity`].
///
/// [`std::convert::identity`]: https://doc.rust-lang.org/std/convert/fn.identity.html
///
/// # Examples
///
/// ```
/// # #![feature(async_await)]
/// # fn main() { async_std::task::block_on(async {
/// #
/// use async_std::future::ready;
///
/// assert_eq!(ready(10).await, 10);
/// #
/// # }) }
/// ```
pub async fn ready<T>(val: T) -> T {
val
}