From f1f6c1286f24f6f762a9b195ac678b55d20c9a9b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 20 Nov 2014 09:23:43 -0800 Subject: 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 --- src/libstd/sync/future.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libstd/sync') 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 Future { impl Future { /// 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 Future { } } + /// 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 -- cgit 1.4.1-3-g733a5