Skip to content

Add no_std support#52

Open
AverageHelper wants to merge 3 commits intofosskers:masterfrom
AverageHelper:avg/no_std
Open

Add no_std support#52
AverageHelper wants to merge 3 commits intofosskers:masterfrom
AverageHelper:avg/no_std

Conversation

@AverageHelper
Copy link
Copy Markdown

I'm hoping to use this crate in a no_std package, but the references to std cause compilation failure. Since some structures, such as NESlice and NEVec, don't rely on std directly, only things re-expored from alloc or core, only a minor refactor of imports and some feature guards are necessary for this crate to be usable in embedded environments.

I tested these changes locally in another crate, and compiled against a target which has no std support (thumbv6m-none-eabi), unit tests seem to pass, so hopefully it all works! (Apologies in advance for the slight added maintenance burden of needing to import against core and alloc instead of std 😅)

I also added CI tests to check that this continually builds in no_std and non-alloc environments. (Both against the same target, since I'm not yet sure of a built-in target where core exists but not alloc.)

@AverageHelper AverageHelper marked this pull request as ready for review March 27, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant