Skip to content

Commit

Permalink
Rollup merge of rust-lang#120458 - rytheo:cstr-conversion-doc, r=Mark…
Browse files Browse the repository at this point in the history
…-Simulacrum

Document `&CStr` to `CString` conversion

Related to rust-lang#51430
  • Loading branch information
matthiaskrgr authored Feb 4, 2024
2 parents ed6321d + 6aec11a commit 1bc76ef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/alloc/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 1bc76ef

Please sign in to comment.