aboutsummaryrefslogtreecommitdiff
path: root/rust/kernel/types.rs
diff options
context:
space:
mode:
authorAlice Ryhl <[email protected]>2023-05-03 14:10:16 +0000
committerMiguel Ojeda <[email protected]>2023-05-31 18:53:10 +0200
commit66bd7533ef19bf8a3515ce702013aba368f58df3 (patch)
tree01750da9020ab71d9df5eedf7e4f82a3f794a2ed /rust/kernel/types.rs
parent4a59081c09cbfe17505baf3db50ebb9b97290bae (diff)
rust: str: add conversion from `CStr` to `CString`
These methods can be used to copy the data in a temporary c string into a separate allocation, so that it can be accessed later even if the original is deallocated. The API in this change mirrors the standard library API for the `&str` and `String` types. The `ToOwned` trait is not implemented because it assumes that allocations are infallible. Reviewed-by: Benno Lossin <[email protected]> Signed-off-by: Alice Ryhl <[email protected]> Reviewed-by: Martin Rodriguez Reboredo <[email protected]> Reviewed-by: Andreas Hindborg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'rust/kernel/types.rs')
0 files changed, 0 insertions, 0 deletions