Skip to content

Commit 1bc76ef

Browse files
authored
Rollup merge of rust-lang#120458 - rytheo:cstr-conversion-doc, r=Mark-Simulacrum
Document `&CStr` to `CString` conversion Related to rust-lang#51430
2 parents ed6321d + 6aec11a commit 1bc76ef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/alloc/src/ffi/c_str.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,8 @@ impl ToOwned for CStr {
10241024

10251025
#[stable(feature = "cstring_asref", since = "1.7.0")]
10261026
impl From<&CStr> for CString {
1027+
/// Converts a <code>&[CStr]</code> into a [`CString`]
1028+
/// by copying the contents into a new allocation.
10271029
fn from(s: &CStr) -> CString {
10281030
s.to_owned()
10291031
}

0 commit comments

Comments
 (0)