-
Notifications
You must be signed in to change notification settings - Fork 949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop custom Either
types
#2650
Comments
Sounds good to me. Also, should we be using |
I am not sure how well maintained I've had a brief look and for example the I think as part of this ticket, one would need to do a bit more research to see if we can drop |
examining it naively the |
This is fixed now: rayon-rs/either#69 There is also a new release coming: rayon-rs/either#73 |
I've opened an issue regarding pin projection which is another blocker for some of our |
Either
types where possibleEither
types where possible
I opened an issue with |
Either
types where possibleEither
types
Update: As suggested in the linked issue, we could simply use the I think that is a sensible way forward. Using the same type everywhere would be better but using two already existing ones is already an improvement over defining our own types in my opinion. |
Unfortunately, this doesn't quite work.
The bottom line is that I think we should convince |
That is also not possible because they already implement |
|
Description
We have a lot of custom
Either
types withinlibp2p-core
, some of which (I think) could go away by implementing our traits directly on theEither
type that we are already depending on.Motivation
Less code to maintain.
Checklist
EitherTransport
: refactor(core)!: removeEitherTransport
#3338EitherError
: refactor(core)!: removeEitherError
in favor ofeither::Either
#3337EitherOutput
: refactor(core)!: removeEitherOutput
#3341EitherUpgrade
: refactor(core)!: removeEitherUpgrade
#3339EitherName
: Cannot be removed at the moment because it would conflict with the blanket implementation ofProtocolName
overT
. This will however be resolved as soon as misc/multistream-select: Treat protocol asString
and not[u8]
#2831 is fixed.EitherFuture
:Future
that returnsEither
and does not force the sameOutput
on both types.Transport::{Dial,ListenUpgrade}
in favor of using trait objects #3347.SelectUpgrade
. That one I believe we cannot remove becauseSelectUpgrade
is for example used to choose between two muxers which is functionality we definitely want. However, in order to make Re-organising crate structure #3271 easier, we can at least move this dedicatedEitherFuture
type into the same crate asSelectUpgrade
because it has only one user.EitherIter
: Cannot be removed becauseEither
does not implementIntoIterator
. If we still need this after misc/multistream-select: Treat protocol asString
and not[u8]
#2831 is merged, we can request it upstream.Are you planning to do it yourself in a pull request?
No / Maybe. Could be a good first issue. What do you think @mxinden?
The text was updated successfully, but these errors were encountered: