mirror of https://github.com/rust-lang/rust.git
Rollup merge of #120458 - rytheo:cstr-conversion-doc, r=Mark-Simulacrum
Document `&CStr` to `CString` conversion Related to #51430
This commit is contained in:
commit
9838e943f3
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue