Re: [PATCH 1/6] rust: alloc: add Vec::push_init
"Eliot Courtney" <[email protected]>
| Newsgroups | dev.linux.lists.nova-gpu,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
> So concretely, what about just: > - push(&mut self, init: impl Init<T>, flags: Flags) -> > Result<(), AllocError> > - try_push<I: Init<T, E>, E>(&mut self, init: I, flags: Flags) -> > Result<(), PushInitError<I, E>> I realised that changing push(v: T) to push(init: impl Init<T>) can weaken the type inference, although there doesn't appear to be any uses in tree that are affected currently. Anyone have any thoughts on this? Otherwise I guess it's push, push_init, try_push_init (but with the error types I suggested).