Commit c3152988 authored by Tamir Duberstein's avatar Tamir Duberstein Committed by Danilo Krummrich
Browse files

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: default avatarAlice Ryhl <aliceryhl@google.com>
Reviewed-by: default avatarBenno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20250318-vec-push-use-spare-v3-1-68741671d1af@gmail.com


Signed-off-by: default avatarTamir Duberstein <tamird@gmail.com>
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
parent 1679b715
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment