Skip to content
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

Re-export Either type for better DX #3622

Closed
bajtos opened this issue Mar 16, 2023 · 2 comments
Closed

Re-export Either type for better DX #3622

bajtos opened this issue Mar 16, 2023 · 2 comments

Comments

@bajtos
Copy link

bajtos commented Mar 16, 2023

Description

In #3337, EitherError was replaced with either::Either. This is fine, except that libp2p does not re-export the Either type, and therefore libp2p consumers have to add either to their dependencies. It's a bit of maintenance overhead and a risk of a versioning conflict.

I propose re-exporting the entire either crate from libp2p.

This will also simplify the upgrade path from v0.50 to v0.51.

- use libp2p::core::either::EitherError;
+ use libp2p::core::either::Either;

Are you planning to do it yourself in a pull request?

Yes, I am happy to contribute a pull request if we agree this is a change you will accept.

Should we export either as libp2::core::either or libp2p::either?

@thomaseizinger
Copy link
Contributor

Given that either is already > 1.0 I am tempted to say that depending on it yourself is the way to go.

@drHuangMHT
Copy link
Contributor

Consider closing this issue?

@thomaseizinger thomaseizinger closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants