-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Feature description
While working with this crate, I have noticed a few corners I'd rather cut:
- dependency on async_trait
- dependency on anyhow
- using std types where alloc would suffice
All of these are rather easy to address with a MSRV bump and minor refactoring.
Btw: it would be nice if this crate could be published on crates.io. It should meet all necessary requirements for that.
Motivation
While porting some IOTA stardust code to IOTA rebased, I needed to integrate this crate's traits into our project. It actually simplified quite a few messy key handling situations.
In the process of porting, I was glad to be able to throw out many uses of async-trait with rebased because other IOTA crates have an MSRV of 1.85. The remaining usage of async-trait in our codebase remain in the traits of this crate. So I was wondering: if there are seemingly no consumers with such a low MSRV, maybe it would be possible to bump it to Rust 1.75 and use RPITIT (fn() -> impl Future<Output = >), dropping the async-trait dependency?
Similarly, I wondered why this pulls in a full anyhow setup for error handling. After all, this is a library. The common ground in the Rust ecosystem is that anyhow is more application-oriented. If your Error::Other needs generic errors, is there a reason it can't be Box<dyn std::error:Error>?
Last but not least, we are implementing these traits in crates that we intend to ship on lower end machines with targets that do not have a full std library. But these targets have alloc. So it would be great, if this library could reduce its assumptions about the std library (of which it actually does not need too much) by being no_std with extern crate alloc; and feature-gating pure-std features. If you would bump the MSRV to Rust 1.81 I don't see any real need for std at all because you could then leverage core::error::Error.
Requirements
Okay, the template requires this but just as a repetition of the feature description rephrased as requirements:
- This library should have the least dependencies possible.
- Core features and alloc should be preferred over std to enable no_std usage.
- Std library features should be gated behind a std feature flag.
- This library should be published to crates.io.
Open questions
If you want, I'd be happy to contribute any/all of these changes. I'd also be happy to discuss our usage of the crate and design.
Are you planning to do it yourself in a pull request?
Yes
Metadata
Metadata
Assignees
Labels
Type
Projects
Status