Re: [PATCH v2 4/4] rust: str: implement `Borrow` and `BorrowMut` for `CString`
From: Benno Lossin
Date: Sat Jun 14 2025 - 15:21:29 EST
On Fri Jun 13, 2025 at 3:46 PM CEST, Alexandre Courbot wrote:
> Implement `Borrow<CStr>` and `BorrowMut<CStr>` for `CString`. This
> allows `CString` to be used in generic APIs asking for types
> implementing those traits. `&CStr` and `&mut CStr` also implement those
> traits allowing users to use either owned or borrowed values.
>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
With the doc comments fixed as detailed in the other thread:
Reviewed-by: Benno Lossin <lossin@xxxxxxxxxx>
---
Cheers,
Benno
> ---
> rust/kernel/str.rs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 49 insertions(+)