mirror of
https://github.com/async-rs/async-std.git
synced 2025-05-02 05:01:25 +00:00
20 lines
423 B
Rust
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
|
|
}
|