summaryrefslogtreecommitdiff
path: root/rust/kernel/platform.rs
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2025-06-16 12:34:05 +0900
committerDanilo Krummrich <dakr@kernel.org>2025-06-18 23:09:21 +0200
commitc09a8ac1cd560c8f944611045841fed99790116b (patch)
tree71e3f83dabe003e001f0f89ac22cb5b5e91f476f /rust/kernel/platform.rs
parent47d8101924b58e03bfd065c972172e6b69331397 (diff)
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 <aliceryhl@google.com> Reviewed-by: Benno Lossin <lossin@kernel.org> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Link: https://lore.kernel.org/r/20250616-borrow_impls-v4-1-36f9beb3fe6a@nvidia.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/kernel/platform.rs')
0 files changed, 0 insertions, 0 deletions