Re: [PATCH v3] rust: alloc: use `spare_capacity_mut` to reduce unsafe

From: Danilo Krummrich
Date: Mon Apr 07 2025 - 11:22:38 EST


On 3/18/25 3:52 PM, Tamir Duberstein wrote:
Use `spare_capacity_mut` in the implementation of `push` to reduce the
use of `unsafe`. Both methods were added in commit 2aac4cd7dae3 ("rust:
alloc: implement kernel `Vec` type").

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
Reviewed-by: Benno Lossin <benno.lossin@xxxxxxxxx>
Signed-off-by: Tamir Duberstein <tamird@xxxxxxxxx>

Applied to rust/alloc-next, thanks!