Skip to content

Commit

Permalink
Document From<&CStr> for CString
Browse files Browse the repository at this point in the history
  • Loading branch information
rytheo committed Jan 28, 2024
1 parent 6351247 commit 6aec11a
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 6aec11a

Please sign in to comment.