Files
linux/rust/kernel
Tamir Duberstein 10a7108d4b rust: str: add CStr methods matching core::ffi::CStr
Prepare for replacing `CStr` with `core::ffi::CStr` by soft-deprecating
methods which don't exist on `core::ffi::CStr`.

We could keep `as_bytes{,_with_nul}` through an extension trait but
seeing as we have to introduce `as_char_ptr_in_const_context` as a free
function, we may as well introduce `to_bytes{,_with_nul}` here to allow
downstream code to migrate in one cycle rather than two.

Link: https://github.com/Rust-for-Linux/linux/issues/1075
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250704-core-cstr-prepare-v1-5-a91524037783@gmail.com
[ Reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-07-21 01:16:36 +02:00
..
2025-07-15 21:01:48 +02:00
2025-06-22 23:09:32 +02:00
2025-06-22 23:08:42 +02:00
2025-03-16 21:59:19 +01:00
2025-07-21 01:16:35 +02:00
2025-07-21 01:16:35 +02:00
2025-07-21 01:16:35 +02:00
2025-07-19 23:18:18 +02:00
2025-06-22 23:09:17 +02:00
2024-10-08 15:44:36 +02:00
2025-07-21 01:16:35 +02:00
2024-11-04 16:21:44 -05:00