about summary refs log tree commit diff
path: root/src/libstd/c_vec.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-25 09:21:45 +0000
committerbors <bors@rust-lang.org>2014-11-25 09:21:45 +0000
commitf6cb58caeedf509cc80dd376bbb2541a0446046b (patch)
tree342842df92d03e14065608b8bef510e7b4980b05 /src/libstd/c_vec.rs
parent0c1d853fba0068f9fd34b43a565ded01b199506c (diff)
parentf1f6c1286f24f6f762a9b195ac678b55d20c9a9b (diff)
downloadrust-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/c_vec.rs')
-rw-r--r--src/libstd/c_vec.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstd/c_vec.rs b/src/libstd/c_vec.rs
index 1267d7411cc..1f94d7b4fa6 100644
--- a/src/libstd/c_vec.rs
+++ b/src/libstd/c_vec.rs
@@ -138,11 +138,15 @@ impl<T> CVec<T> {
     /// Note that if you want to access the underlying pointer without
     /// cancelling the destructor, you can simply call `transmute` on the return
     /// value of `get(0)`.
-    pub unsafe fn unwrap(mut self) -> *mut T {
+    pub unsafe fn into_inner(mut self) -> *mut T {
         self.dtor = None;
         self.base
     }
 
+    /// Deprecated, use into_inner() instead
+    #[deprecated = "renamed to into_inner()"]
+    pub unsafe fn unwrap(self) -> *mut T { self.into_inner() }
+
     /// Returns the number of items in this vector.
     pub fn len(&self) -> uint { self.len }