Skip to content

feat: support no-alloc targets - #179

Merged
robjtede merged 1 commit into
masterfrom
agent/no-alloc-support
Jul 31, 2026
Merged

feat: support no-alloc targets#179
robjtede merged 1 commit into
masterfrom
agent/no-alloc-support

Conversation

@robjtede

@robjtede robjtede commented Jul 31, 2026

Copy link
Copy Markdown
Member

Closes #140

Summary

  • Add an alloc feature, enabled by std and serde.
  • Gate allocation-dependent formatting and parsing APIs behind alloc.
  • Retain the existing no_std + alloc fixture and add a separate allocator-free fixture.
  • Build both embedded configurations in CI.

Why

Users that only need ByteSize, constants, conversions, arithmetic, and Unit can now disable default features without linking an allocator.

Parsing keeps its existing String error type and remains behind alloc. A future breaking release can add allocation-free parsing errors without changing much except error types.

Validation

  • just check
  • just test
  • just test-msrv
  • just build-no-std
  • just build-no-alloc

@robjtede
robjtede marked this pull request as ready for review July 31, 2026 12:00
@robjtede
robjtede merged commit 420a933 into master Jul 31, 2026
22 checks passed
@robjtede
robjtede deleted the agent/no-alloc-support branch July 31, 2026 12:05
@nazar-pc

nazar-pc commented Aug 2, 2026

Copy link
Copy Markdown

This was a breaking change for those who had default-features = false since .display() would suddenly be missing after upgrade

@robjtede

robjtede commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

Fair enough. Yanked v2.5.0 and v2.6.0.

Usually adding new default features is okay but in this case you're right, it's not good that it removed an existing function in the process.

I'll get on cherry-picking the other parts of those releases soon.

@robjtede

robjtede commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

v2.7.0 released which reverts the alloc feature addition.

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.

Support for no-alloc environments

2 participants