http icon indicating copy to clipboard operation
http copied to clipboard

no_std support

Open olanod opened this issue 3 years ago • 10 comments

This PR turns the crate into no_std compatible replacing std references with core + alloc and adding the std feature where needed(std::error::Error support).
Also tried to make the dependency on HashMap optional making extensions an optional feature, the ahash dependency shouldn't be an issue since it's already a dependency of hashbrown which is the the std HashMap implementation.

olanod avatar Jul 28 '22 22:07 olanod

TypeId implements Ord, so how about using BTreeMap for extensions if there is no std, rather than not having it?

jplatte avatar Sep 08 '22 07:09 jplatte

This looks really good. Wonder if the crate authors will get time to consider it?

algesten avatar Sep 30 '23 21:09 algesten

Hm. I guess it doesn't get rid of allocations cause it relies on the extern crate alloc

algesten avatar Oct 01 '23 07:10 algesten

I'm not sure about getting this into 1.0, but I do want to allow for it. I think the only breaking change would be to add a std feature that is default-on, yea? Then we could eventually fix up support with it off.

seanmonstar avatar Nov 10 '23 14:11 seanmonstar

Yes. I got a feeling i've seen more std feature flags than the opposite no_std. Either way works though.

algesten avatar Nov 10 '23 22:11 algesten

I created #637 which does that, allowing us to eventually add support later.

seanmonstar avatar Nov 10 '23 22:11 seanmonstar