1
Fork 0

Clarify docs on CString.unwrap()

CString.unwrap() drops ownership of the buffer on the floor. Put this in
the docs.
This commit is contained in:
Kevin Ballard 2013-08-14 19:18:24 -07:00
parent 927aff1724
commit 1e4f13f95f

View file

@ -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;