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

From: Andrew Ballance
Date: Mon Apr 07 2025 - 16:13:56 EST


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@xxxxxxxxx>

This looks cleaner than my version.

Reviewed-by: Andrew Ballance <andrewjballance@xxxxxxxxx>