FROMGIT: rust: alloc: refactor `Vec::truncate` using `dec_len`
Use `checked_sub` to satisfy the safety requirements of `dec_len` and replace nearly the whole body of `truncate` with a call to `dec_len`. Reviewed-by:Andrew Ballance <andrewjballance@gmail.com> Reviewed-by:
Alice Ryhl <aliceryhl@google.com> Signed-off-by:
Tamir Duberstein <tamird@gmail.com> Link: https://lore.kernel.org/r/20250416-vec-set-len-v4-3-112b222604cd@gmail.com [ Remove #[expect(unused)] from dec_len(). - Danilo ] Signed-off-by:
Danilo Krummrich <dakr@kernel.org> Bug: 414994413 (cherry picked from commit 1b04b466 https://github.com/Rust-for-Linux/linux.git alloc-next) Change-Id: I7b1137306936289037bd315d32bb4ca893d38419 Signed-off-by:
Alice Ryhl <aliceryhl@google.com>
Loading
Please sign in to comment