-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
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]whenstdfeature is disabled - Use
hashbrown::HashMapin no_std mode (std mode usesstd::collections::HashMap) - Use
num-traitswith 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-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.
Metadata
Metadata
Assignees
Labels
No labels