Skip to content

Conversation

@wojciech-graj
Copy link
Contributor

@wojciech-graj wojciech-graj commented Sep 10, 2025

I have a no_alloc and no_std use-case, and it's fortunately quite a simple patch to add support for this. I have tested this patch on a target that doesn't have std, and it works like a charm.

By adding the #[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] attribute to the few things in bitstream-io that can't function without alloc, docs-rs will automatically point out that this is only available with the alloc feature. You can also test this locally by running RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc.

Additionally, tests now require std so you don't have to muck around with making all of the tests compatible with no_std and especially no_alloc, as per this advice.

This change is also forwards-compatible, so it will only require a minor version bump.

Closes #5

@tuffy tuffy merged commit f3c8cf2 into tuffy:master Sep 10, 2025
1 check passed
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.

Usage in Embedded Systems

2 participants