| 1 | /// Resolves to the provided value. |
|---|---|
| 2 | /// |
| 3 | /// This function is an async version of [`std::convert::identity`]. |
| 4 | /// |
| 5 | /// [`std::convert::identity`]: https://doc.rust-lang.org/std/convert/fn.identity.html |
| 6 | /// |
| 7 | /// # Examples |
| 8 | /// |
| 9 | /// ``` |
| 10 | /// # async_std::task::block_on(async { |
| 11 | /// # |
| 12 | /// use async_std::future; |
| 13 | /// |
| 14 | /// assert_eq!(future::ready(10).await, 10); |
| 15 | /// # |
| 16 | /// # }) |
| 17 | /// ``` |
| 18 | pub async fn ready<T>(val: T) -> T { |
| 19 | val |
| 20 | } |
| 21 |
