Re: [PATCH] rust: types: remove `Either<L, R>`
From: Alice Ryhl
Date: Mon May 19 2025 - 14:13:20 EST
On Mon, May 19, 2025 at 11:08 AM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Mon, May 19, 2025 at 7:30 PM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
> >
> > I don't mind making a custom enum, but I do use this in Rust Binder.
>
> Yeah, Wedson added the type back then for Binder and kasync from a
> quick look -- in those times, I see it in a few places only, e.g. in
> `get_work_or_register`. Do you have many nowadays?
>
> i.e. I don't want to add extra work for upstreaming Rust Binder, so if
> that would make it harder downstream, we can live with it for the
> moment.
>
> We may want to add a line in the docs to ask the potential user to
> consider whether a custom enum would be better nevertheless.
It's used get_work_or_register to return either work, or a
registration waiting for work if the work list is empty. I believe
there is only that one use.
Alice