Closed rmsyn closed 1 year ago
Why is alloc needed? (It can cause issues with certain no_std usage)
Why is alloc needed? (It can cause issues with certain no_std usage)
The library uses containers and traits that require dynamic allocation (notably String
and Vec
). It's possible to make more changes to feature-gate the parts of the library that require dynamic allocation behind an alloc
feature.
It might also be possible to convert the usage to heapless
variants that have a static capacity at compile-time. Especially for report descriptors, where the max size is known (64 bytes), heapless
variants should be a very easy replacement.
For this PR, I just did the most straight forward thing. If a user has a problem with alloc
usage, I can't see how they ever got the std
versions to work.
I personally haven't had any issues with the macro crate and no_std. However, I enable the 'host_dep
cargo feature: https://github.com/rust-lang/cargo/issues/7915 in my environments.
Please fix up the checks and this should be good.
Converts the
macros
crate tono_std
. Avoids indirectly includingstd
library in ano_std
crate.