diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b6a30d17c..673f7b2f8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.3.2 - 2020-??-?? +* Added `into_inner` method for `future::Ready` (#2055) + # 0.3.1 - 2019-11-7 * Fix signature of `LocalSpawn` trait (breaking change -- see #1959) @@ -5,7 +8,7 @@ * Stable release along with stable async/await! * Added async/await to default features (#1953) * Changed `Spawn` trait and `FuturesUnordered::push` to take `&self` (#1950) -* Moved `Spawn` and `FutureObj` out of `futures-core` and into `futures-task (#1925) +* Moved `Spawn` and `FutureObj` out of `futures-core` and into `futures-task` (#1925) * Changed case convention for feature names (#1937) * Added `executor` feature (#1949) * Moved `copy_into`/`copy_buf_into` (#1948) diff --git a/futures-util/src/future/ready.rs b/futures-util/src/future/ready.rs index 94e6d35563..48661b3d84 100644 --- a/futures-util/src/future/ready.rs +++ b/futures-util/src/future/ready.rs @@ -7,6 +7,14 @@ use futures_core::task::{Context, Poll}; #[must_use = "futures do nothing unless you `.await` or poll them"] pub struct Ready(Option); +impl Ready { + /// Unwraps the value from this immediately ready future. + #[inline] + pub fn into_inner(mut self) -> T { + self.0.take().unwrap() + } +} + impl Unpin for Ready {} impl FusedFuture for Ready { @@ -24,7 +32,7 @@ impl Future for Ready { } } -/// Create a future that is immediately ready with a value. +/// Creates a future that is immediately ready with a value. /// /// # Examples ///