WSL2-Linux-Kernel/rust/kernel
Gary Guo d126d23801 rust: str: add `CStr` type
Add the `CStr` type, which is a borrowed string that is guaranteed
to have exactly one `NUL` byte, which is at the end.

It is used for interoperability with kernel APIs that take C strings.

Add it to the prelude too.

Co-developed-by: Alex Gaynor <alex.gaynor@gmail.com>
Signed-off-by: Alex Gaynor <alex.gaynor@gmail.com>
Co-developed-by: Milan Landaverde <milan@mdaverde.com>
Signed-off-by: Milan Landaverde <milan@mdaverde.com>
Signed-off-by: Gary Guo <gary@garyguo.net>
[Reworded, adapted for upstream and applied latest changes]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-12-04 01:59:15 +01:00
..
allocator.rs
error.rs rust: error: add `From` implementations for `Error` 2022-12-04 01:59:15 +01:00
lib.rs rust: error: add `From` implementations for `Error` 2022-12-04 01:59:15 +01:00
prelude.rs rust: str: add `CStr` type 2022-12-04 01:59:15 +01:00
print.rs rust: print: add `pr_cont!` macro 2022-12-01 20:12:44 +01:00
str.rs rust: str: add `CStr` type 2022-12-04 01:59:15 +01:00