diff options
| author | Ryan Lowe <rytheo@users.noreply.github.com> | 2024-01-28 13:27:17 -0500 |
|---|---|---|
| committer | Ryan Lowe <rytheo@users.noreply.github.com> | 2024-01-28 16:53:57 -0500 |
| commit | 6aec11afbcf3acd195818948a3e7a8d5b337b78a (patch) | |
| tree | 0928768a83f550384a85e5a0b204272bd2e4cb7f | |
| parent | 635124704849eeead4e3a7bb6e663c5351571d93 (diff) | |
| download | rust-6aec11afbcf3acd195818948a3e7a8d5b337b78a.tar.gz rust-6aec11afbcf3acd195818948a3e7a8d5b337b78a.zip | |
Document From<&CStr> for CString
| -rw-r--r-- | library/alloc/src/ffi/c_str.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/alloc/src/ffi/c_str.rs b/library/alloc/src/ffi/c_str.rs index 4a4a3abd47f..9419b0cfb24 100644 --- a/library/alloc/src/ffi/c_str.rs +++ b/library/alloc/src/ffi/c_str.rs @@ -1024,6 +1024,8 @@ impl ToOwned for CStr { #[stable(feature = "cstring_asref", since = "1.7.0")] impl From<&CStr> for CString { + /// Converts a <code>&[CStr]</code> into a [`CString`] + /// by copying the contents into a new allocation. fn from(s: &CStr) -> CString { s.to_owned() } |
