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

Add std feature flag #131

Closed
lucascool12 opened this issue May 16, 2024 · 3 comments · Fixed by #132
Closed

Add std feature flag #131

lucascool12 opened this issue May 16, 2024 · 3 comments · Fixed by #132

Comments

@lucascool12
Copy link

Currently the croaring crate depends on the rust standard library even though it doesn't use any particular features that are only available in the std library (as far as I've seen).
Adding a std feature flag would allow this crate to be used in environments that are unable/unwilling to depend on the rust standard library, such as embedded environments.

@Dr-Emann
Copy link
Member

At least the TreeMap type is backed by a BTreeMap, and things like serialize/serialize_into use Vec.

But it does seem like it wouldn't be too difficult to only require alloc, and provide a fully no-std build too.

@Dr-Emann
Copy link
Member

Ah, one thing is our use of std::panic::catch_unwind, which isn't available outside of std, and there's not really a path currently to getting it in core/alloc AFAICS. I don't think there's a safe way to pass an arbitrary callback to C without it, but we could provide a std feature by default, and an alloc feature, and a completely no-std version without either.

@Dr-Emann
Copy link
Member

Released as croaring 2.0:

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