SergioBenitez / state

A Rust library for safe and effortless global and thread-local state management.
Other
209 stars 13 forks source link

It's unclear it is not supposed to work with stable Rust #5

Closed michalfita closed 5 years ago

michalfita commented 5 years ago

Please put a big notice in the README.md that today it's not supposed to work with stable Rust due to mandatory requirement of const fn not yet stabilised. It's not enough cleared in the documentation.

Thank you.

michalfita commented 5 years ago

Why closing without any response?

SergioBenitez commented 5 years ago

Sincerest apologies! I mistakenly believed this was an issue on Rocket's tracker. We go to great lengths to ensure that we're clear Rocket doesn't work on stable.

Nevertheless, this library doesn't require Rust nightly. It works just fine on stable. If you want const constructors, you can enable the const_fn feature (and the corresponding Rust feature), which of course requires nightly. All of this is both in the README and in the rustdocs.

michalfita commented 5 years ago

Thanks for explanation. I tried to use Storage in 1.31.1 and it won't work without const fn... IMVHO documentation shall be more clear when and what is available with the const fn feature and without.

I managed to achieve what I need without state crate finally. However, I'd like to return to it once const fn is stabilised.

BTW. it's like third case I'm finding stable const fn would be seriously useful.