Skip to content

Commit

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

Document `&CStr` to `CString` conversion

Related to rust-lang#51430
  • Loading branch information
rust-timer committed Feb 5, 2024
2 parents 0984bec + 6aec11a commit 93b85b0
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 93b85b0

Please sign in to comment.