Re: [PATCH] rust: alloc: implement `extend` for `Vec`

From: Alexandre Courbot
Date: Sat Apr 05 2025 - 09:51:15 EST


On Sat Apr 5, 2025 at 10:26 PM JST, Alexandre Courbot wrote:
> KVec currently has `extend_with` and `extend_from_slice` methods, but no
> way extend a vector from a regular iterator as provided by the `Extend`
> trait.
>
> Due to the need to provide the GFP flags, `Extend` cannot be implemented
> directly, so simply define a homonymous method that takes an extra
> `flags` argument.
>
> The aforementioned `extend_with` and `extend_from_slice` can then be
> reimplemented as direct invocations of this new method - maybe they can
> eventually be removed.
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>

Argh, I did not notice that the code in the diff was no needlessly
intermingled. Let me change the diff algorithm and send a more readable
version.