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

Implement std::error::Error for CollectionAllocErr #355

Closed
JarvisCraft opened this issue May 13, 2024 · 1 comment · Fixed by #356
Closed

Implement std::error::Error for CollectionAllocErr #355

JarvisCraft opened this issue May 13, 2024 · 1 comment · Fixed by #356

Comments

@JarvisCraft
Copy link
Contributor

Description

It seems unnatural that CollectionAllocErr currently does not implement std::error::Error which would come in handy in cases such as implementing std::error::Error::source on user-defined errors caused by CollectionAllocErr.

While error_in_core is not stable yet, such implementation could be hidden behind a feature flag such as (commmonly used) std.

Since the features should be additive (i.e. an inverted no-std feature would not be the right approach), it is a breaking change to add such a feature so I suggest adding this to #183.

If this change is welcome, I may create a pull request to implement it.

cc @mbrubeck as the maintainer of the 2.0 wishlist

@mbrubeck
Copy link
Collaborator

Yes, a pull request to the v2 branch would be welcome.

I don't think this is a breaking change. Adding a disabled-by-default std feature should have no effect on existing users of the crate. However, I prefer not to make any unnecessary changes to v1 at this point. Also, if we do this on v2 then we can also deprecate the write feature in favor of the new std feature.

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

Successfully merging a pull request may close this issue.

2 participants