Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPropagate either feature and enable by default from the facade #1151
Conversation
Nemo157
referenced this pull request
Jul 31, 2018
Open
either dependency is non-optional for futures-util #1152
This comment has been minimized.
This comment has been minimized.
|
Is this primarily for streams and sinks? Because we can no longer implement |
This comment has been minimized.
This comment has been minimized.
|
I didn’t actually check what it enabled, I just noticed it wasn’t propagated when looking at the compat stuff. Maybe it would be better to just drop the either stuff now that it can’t be implemented for |
This comment has been minimized.
This comment has been minimized.
|
I still think that some form or another of the either stuff is still needed so long as we don't have |
This comment has been minimized.
This comment has been minimized.
|
We could introduce a
e.g. enum Coalesce3<T1, T2, T3> {
Variant1(T1),
Variant2(T2),
Variant3(T3),
}That enum would be local to our crate. We can add a correct impl<T1: Unpin, T2: Unpin, T3: Unpin> Unpin for Coalesce3 {}and The main advantage is of course that we can add support for more than two variants. I'd say five, like we have for Edit: I don't think that we should add combinator methods for this. At least I think so :) |
This comment has been minimized.
This comment has been minimized.
|
@MajorBreakfast I have a macro that does this in fuchsia already. However, I realized that it is |
This comment has been minimized.
This comment has been minimized.
|
@cramertj I actually didn't consider that we could make the macro public. But it makes sense to do so. If it's prefixed with I think it makes sense to expose the macro because I'm certain that someone can come up with a use case that requires 12 variants. |
This comment has been minimized.
This comment has been minimized.
|
@MajorBreakfast okay! yeah, in that case you can just drag-and-drop https://fuchsia.googlesource.com/garnet/+/sandbox/cramertj/asyncing/public/rust/crates/fuchsia-async/src/lib.rs#46 (although you'd want to change the You'd also want to add the The |
This comment has been minimized.
This comment has been minimized.
|
I'd prefer to remove the I suggest to not add any combinator methods. If we added methods for |
Nemo157 commentedJul 31, 2018
No description provided.