num-derive
num-derive copied to clipboard
Make Float work with no_std
The Float macro is referencing ::std::num::FpCategory and thus doesn't work with no_std yet. Replacing it with ::core::num::FpCategory shouldn't break any existing code but provides no_std compatibility when needed.
After doing this change, I added two more commits to my fork. I think these should be pretty noncontroversial. Otherwise I'd already be happy if only the first one (e1a99e1) got merged.
The core
change and the double-borrowing fix are fine.
I'm less comfortable with the inline(always)
change. We don't have enough information to judge that this is always best. For example, a bottom-up inliner might have already pushed a lot of code inline into these delegation functions, but then forcing that to inline even more could be worse for all those additional call sites. Better to let the optimizer figure it out.
Merged in #56 without the inline change.