diff options
| author | bors <bors@rust-lang.org> | 2014-11-25 09:21:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-11-25 09:21:45 +0000 |
| commit | f6cb58caeedf509cc80dd376bbb2541a0446046b (patch) | |
| tree | 342842df92d03e14065608b8bef510e7b4980b05 /src/libstd/sync/future.rs | |
| parent | 0c1d853fba0068f9fd34b43a565ded01b199506c (diff) | |
| parent | f1f6c1286f24f6f762a9b195ac678b55d20c9a9b (diff) | |
| download | rust-f6cb58caeedf509cc80dd376bbb2541a0446046b.tar.gz rust-f6cb58caeedf509cc80dd376bbb2541a0446046b.zip | |
auto merge of #19149 : alexcrichton/rust/issue-19091, r=aturon
This change applies the conventions to unwrap listed in [RFC 430][rfc] to rename non-failing `unwrap` methods to `into_inner`. This is a breaking change, but all `unwrap` methods are retained as `#[deprecated]` for the near future. To update code rename `unwrap` method calls to `into_inner`. [rfc]: https://github.com/rust-lang/rfcs/pull/430 [breaking-change] cc #19091
Diffstat (limited to 'src/libstd/sync/future.rs')
| -rw-r--r-- | src/libstd/sync/future.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstd/sync/future.rs b/src/libstd/sync/future.rs index 3e1ba8cebf8..d6f413a0828 100644 --- a/src/libstd/sync/future.rs +++ b/src/libstd/sync/future.rs @@ -54,7 +54,7 @@ impl<A:Clone> Future<A> { impl<A> Future<A> { /// Gets the value from this future, forcing evaluation. - pub fn unwrap(mut self) -> A { + pub fn into_inner(mut self) -> A { self.get_ref(); let state = replace(&mut self.state, Evaluating); match state { @@ -63,6 +63,10 @@ impl<A> Future<A> { } } + /// Deprecated, use into_inner() instead + #[deprecated = "renamed to into_inner()"] + pub fn unwrap(self) -> A { self.into_inner() } + pub fn get_ref<'a>(&'a mut self) -> &'a A { /*! * Executes the future's closure and then returns a reference |
