diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-11-20 09:23:43 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-11-23 15:26:53 -0800 |
| commit | f1f6c1286f24f6f762a9b195ac678b55d20c9a9b (patch) | |
| tree | f95740892f854ef95174a277367aba1397273422 /src/libstd/sync | |
| parent | 4e5259503cd8aac9905c7ac6d68d0c4caab1d28c (diff) | |
| download | rust-f1f6c1286f24f6f762a9b195ac678b55d20c9a9b.tar.gz rust-f1f6c1286f24f6f762a9b195ac678b55d20c9a9b.zip | |
Rename unwrap functions to into_inner
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] Closes #13159 cc #19091
Diffstat (limited to 'src/libstd/sync')
| -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 e37d1f83877..567f809df7e 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 |
