Hi! I'm interested in using quantizr in a no_std environment (embedded/WASM use cases).
I've prepared a PR (#2) that adds no_std + alloc support with minimal changes:
Changes:
- Conditional
#![no_std] when std feature is disabled
- Use
hashbrown::HashMap in no_std mode (std mode uses std::collections::HashMap)
- Use
num-traits with libm for f32 math methods (sqrt, round, powf) in no_std
- Replace
std::arch → core::arch, std::fmt → core::fmt, etc.
- Use
core::error::Error (stable since Rust 1.81)
Usage:
# Default (std) - no change
quantizr = "1.4.3"
# no_std + alloc
quantizr = { version = "1.4.3", default-features = false }
Dependencies added:
hashbrown (only used in no_std mode)
num-traits with libm feature (only used in no_std mode)
All existing tests pass, and the crate builds successfully on thumbv7em-none-eabihf.
Would you be interested in this functionality? Happy to adjust the implementation based on feedback.
Hi! I'm interested in using quantizr in a
no_stdenvironment (embedded/WASM use cases).I've prepared a PR (#2) that adds
no_std + allocsupport with minimal changes:Changes:
#![no_std]whenstdfeature is disabledhashbrown::HashMapin no_std mode (std mode usesstd::collections::HashMap)num-traitswith libm for f32 math methods (sqrt,round,powf) in no_stdstd::arch→core::arch,std::fmt→core::fmt, etc.core::error::Error(stable since Rust 1.81)Usage:
Dependencies added:
hashbrown(only used in no_std mode)num-traitswith libm feature (only used in no_std mode)All existing tests pass, and the crate builds successfully on
thumbv7em-none-eabihf.Would you be interested in this functionality? Happy to adjust the implementation based on feedback.