Rollup merge of #120458 - rytheo:cstr-conversion-doc, r=Mark-Simulacrum

Document `&CStr` to `CString` conversion

Related to #51430
This commit is contained in:
Matthias Krüger 2024-02-05 06:37:14 +01:00 committed by GitHub
commit 9838e943f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -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()
}