rust: alloc: use `spare_capacity_mut` to reduce unsafe
Use `spare_capacity_mut` in the implementation of `push` to reduce the use of `unsafe`. Both methods were added in commit 2aac4cd7 ("rust: alloc: implement kernel `Vec` type"). Reviewed-by:Alice Ryhl <aliceryhl@google.com> Reviewed-by:
Benno Lossin <benno.lossin@proton.me> Link: https://lore.kernel.org/r/20250318-vec-push-use-spare-v3-1-68741671d1af@gmail.com Signed-off-by:
Tamir Duberstein <tamird@gmail.com> Signed-off-by:
Danilo Krummrich <dakr@kernel.org>
Loading
Please sign in to comment