about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-11-20 09:23:43 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-11-23 15:26:53 -0800
commitf1f6c1286f24f6f762a9b195ac678b55d20c9a9b (patch)
treef95740892f854ef95174a277367aba1397273422 /src/libstd/sync
parent4e5259503cd8aac9905c7ac6d68d0c4caab1d28c (diff)
downloadrust-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.rs6
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