2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-05-02 05:01:25 +00:00
async-std/src/future/ready.rs
2019-10-13 16:33:02 +09:00

20 lines
423 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
///
/// ```
/// # async_std::task::block_on(async {
/// #
/// use async_std::future;
///
/// assert_eq!(future::ready(10).await, 10);
/// #
/// # })
/// ```
pub async fn ready<T>(val: T) -> T {
val
}