diff options
| author | Alexandre Courbot <[email protected]> | 2025-06-16 03:34:05 +0000 |
|---|---|---|
| committer | Danilo Krummrich <[email protected]> | 2025-06-18 21:09:21 +0000 |
| commit | c09a8ac1cd560c8f944611045841fed99790116b (patch) | |
| tree | 71e3f83dabe003e001f0f89ac22cb5b5e91f476f /rust/helpers/platform.c | |
| parent | rust: vec: impl Default for Vec with any allocator (diff) | |
| download | kernel-c09a8ac1cd560c8f944611045841fed99790116b.tar.gz kernel-c09a8ac1cd560c8f944611045841fed99790116b.zip | |
rust: alloc: implement `Borrow` and `BorrowMut` for `Vec`
Implement `Borrow<[T]>` and `BorrowMut<[T]>` for `Vec<T>`. This allows
`Vec<T>` to be used in generic APIs asking for types implementing those
traits. `[T; N]` and `&mut [T]` also implement those traits allowing
users to use either owned, borrowed and heap-owned values.
The implementation leverages `as_slice` and `as_mut_slice`.
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
Signed-off-by: Alexandre Courbot <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Danilo Krummrich <[email protected]>
Diffstat (limited to 'rust/helpers/platform.c')
0 files changed, 0 insertions, 0 deletions
