From 1e4f13f95fc629bcee2ad9a766d9af7c7b2e18f7 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Wed, 14 Aug 2013 19:18:24 -0700 Subject: [PATCH] Clarify docs on CString.unwrap() CString.unwrap() drops ownership of the buffer on the floor. Put this in the docs. --- src/libstd/c_str.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstd/c_str.rs b/src/libstd/c_str.rs index 7e313543660..bf2d55aa0b2 100644 --- a/src/libstd/c_str.rs +++ b/src/libstd/c_str.rs @@ -34,6 +34,7 @@ impl CString { } /// Unwraps the wrapped `*libc::c_char` from the `CString` wrapper. + /// Any ownership of the buffer by the `CString` wrapper is forgotten. pub unsafe fn unwrap(self) -> *libc::c_char { let mut c_str = self; c_str.owns_buffer_ = false;