Closed TheVova closed 5 years ago
Okay, so I tried to do this, thinking it would be simple, and thanks to cargo it is anything but:
frunk_derives
would require the newly-added std
feature of frunk_core
.frunk_core
has frunk_derives
(as well as frunk
) listed under [dev-dependencies]
, so that doctests can use them.dev-dependencies
cannot be optional, because lolidunno. https://github.com/rust-lang/cargo/issues/1596As a result, it is impossible to deselect any feature of frunk_core
that is required by doctests.
Wait a second. The doctests actually probably don't require the std
feature.
i mean, hold on..disregarding the doc tests for now, i see nothing in frunk_core's code that depends on something that is std-only.. the derives are standard stuff using proc-macros, which is fine even for no_std programs... essentially you seem to say its more of a cargo issue (building and linking) then a code issue, if i understand it right?
No, I made a mistake. Working on it...
Heya! I work a lot on embedded no_std projects, and i think having Frunk (or rather, a subset) be no_std compatible would be very nice. I looked through the code, and everything using std::cmp, std::ops, marker types, std::cell, etc is available under core as well. The main culprit are the impls for monoid and semigroup, because the collections crate is usually not available. However, there are alternatives (for example, for vec and hashmaps: https://japaric.github.io/heapless/heapless/index.html). I Dont think it would be that hard to split it off in a nice way as to allow impls of monoid and friends to be under a cfg flag, for example. I'd like to help if there is some interest, would just like to know if there is a massive use case for std that i totally missed :)