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

*: Replace implementations of Display and Error on errors with thiserror #2509

Closed
mxinden opened this issue Feb 11, 2022 · 8 comments
Closed
Labels
difficulty:easy getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted

Comments

@mxinden
Copy link
Member

mxinden commented Feb 11, 2022

I would argue that a generated implementation of Display and Error via thiserror is faster to write and easier to maintain. Thus I advocate for using thiserror for most of not all libp2p error types.

@mxinden mxinden added difficulty:easy help wanted getting-started Issues that can be tackled if you don't know the internals of libp2p very well labels Feb 11, 2022
@demfabris
Copy link
Contributor

I got this

@dignifiedquire
Copy link
Member

This means adding another error related dependency, that has no no_std support. :/

Ref dtolnay/thiserror#64

@demfabris
Copy link
Contributor

@mxinden thoughts?

@mxinden
Copy link
Member Author

mxinden commented Feb 16, 2022

This means adding another error related dependency, that has no no_std support. :/

We already depend on thiserror in most libp2p-xxx crates, e.g. libp2p-swarm and libp2p-core. In addition, in case we ever decide to be no_std compatible, I don't think it is particularly hard to revert this change, in the sense that it would not be particularly interwoven with other functionality.

I don't have much experience with no_std. With the discussions in #627 in mind, I wonder whether this is a goal we can achieve in the first place. @dignifiedquire do you think no_std is a goal worth striving for?

@dignifiedquire
Copy link
Member

if we already depend on it, then nvm in regards to this specific instance

@mxinden
Copy link
Member Author

mxinden commented Feb 18, 2022

@demfabris still want to tackle this one? 😇

@demfabris
Copy link
Contributor

Yep @mxinden 👍🏻

@thomaseizinger
Copy link
Contributor

I'll close this as stale. I don't think it worth having an issue around to track this.

@thomaseizinger thomaseizinger closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty:easy getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted
Projects
None yet
Development

No branches or pull requests

4 participants