Re: [PATCH v4 10/14] rust: alloc: add `Box::into_pin`
From: Andreas Hindborg
Date: Fri Dec 06 2024 - 16:28:32 EST
"Danilo Krummrich" <dakr@xxxxxxxxxx> writes:
> On Fri, Dec 06, 2024 at 08:33:02PM +0100, Andreas Hindborg wrote:
>> Add an associated function to convert a `Box<T>` into a `Pin<Box<T>>`.
>
> What do you need this function for?
>
> There is an `impl<T, A> From<Box<T, A>> for Pin<Box<T, A>>` already.
>
I didn't realize, but that could work as well. I was rebasing this
series from before we did our own `Box`, and rust `Box` has this method,
which I was using.
At any rate, I think it would make sense to have `into_pin` as well as
the `From` impl, to match the standard library. We could always
implement one in terms of the other.
Best regards,
Andreas Hindborg