Re: [PATCH v3 3/4] rust: alloc: refactor `Vec::truncate` using `dec_len`

Andrew Ballance
2025-04-07T19:59:48Z

On Mon, Apr 07, 2025 at 10:52:33AM -0400, Tamir Duberstein wrote:
> 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`.
>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>

This looks cleaner than my version.

Reviewed-by: Andrew Ballance <andrewjballance@gmail.com>