Re: [PATCH 1/4] rust: alloc: implement `Borrow` and `BorrowMut` for `Vec`

From: Benno Lossin
Date: Sun Jun 01 2025 - 12:12:09 EST


On Sun Jun 1, 2025 at 5:00 AM CEST, Alexandre Courbot wrote:
> Implement these two common traits, which allow generic types to store
> either an owned value or a reference to it.

I don't understand the second part of the sentence.

> The implementation leverages `as_slice` and `as_mut_slice`.
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> ---
> rust/kernel/alloc/kvec.rs | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)

The code itself looks good.

---
Cheers,
Benno