Skip to content

Commit

Permalink
doc: fixed swapped docs for from_ptr and from_raw
Browse files Browse the repository at this point in the history
  • Loading branch information
tsurai committed Oct 1, 2015
1 parent e5ba127 commit 566dc9c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libstd/ffi/c_str.rs
Expand Up @@ -230,11 +230,11 @@ impl CString {
/// Transfers ownership of the string to a C caller.
///
/// The pointer must be returned to Rust and reconstituted using
/// `from_raw` to be properly deallocated. Specifically, one
/// `from_ptr` to be properly deallocated. Specifically, one
/// should *not* use the standard C `free` function to deallocate
/// this string.
///
/// Failure to call `from_raw` will lead to a memory leak.
/// Failure to call `from_ptr` will lead to a memory leak.
#[unstable(feature = "cstr_memory2", reason = "recently added",
issue = "27769")]
#[deprecated(since = "1.4.0", reason = "renamed to into_raw")]
Expand All @@ -245,11 +245,11 @@ impl CString {
/// Transfers ownership of the string to a C caller.
///
/// The pointer must be returned to Rust and reconstituted using
/// `from_ptr` to be properly deallocated. Specifically, one
/// `from_raw` to be properly deallocated. Specifically, one
/// should *not* use the standard C `free` function to deallocate
/// this string.
///
/// Failure to call `from_ptr` will lead to a memory leak.
/// Failure to call `from_raw` will lead to a memory leak.
#[stable(feature = "cstr_memory", since = "1.4.0")]
pub fn into_raw(self) -> *mut libc::c_char {
Box::into_raw(self.inner) as *mut libc::c_char
Expand Down

0 comments on commit 566dc9c

Please sign in to comment.