Skip to content

Conversation

sgued
Copy link
Contributor

@sgued sgued commented Aug 19, 2025

@zeenix tell me if you would add anything else.

Once OK I'll release heapless and I'll add this to This Week In Rust.

I've only tested it with an up to date version of Zola so #199 should probably be merged first.

@sgued sgued requested a review from a team as a code owner August 19, 2025 20:07
Copy link

@zeenix zeenix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @sgued ! I can only offer nitpicks. :)


# Heapless `0.9.1` released

Almost 2 years after the last release, the [heapless](https://github.com/rust-embedded/heapless) crate has a new release. The first attempt at a `0.9.0` release was yanked due to including more breaking changes than intended. This has been fixed, and `0.9.1` has been released today.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the nitpick but could we please keep all the lines under 100 chars and break lines on the word boundary based on this limit rather than for starting a new sentence (in the same paragraph)? 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing entries don't do that. My editor (helix) handles word wrapping very well, I don't really want to do this manually and would rather focus on the content than the formatting. Markdown and Zola are here to handle the formatting.

# The `LenType` optimization

Most often, buffers in embedded applications will not contain a huge number of items.
Until `0.9.1` the capacity of the `heapless` data structures were almost always stored as a `usize`, which can often encode much more values than necessary.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capacity -> capacities

Copy link
Contributor Author

@sgued sgued Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. Capacities plural seems weird. I read it as the capacity of each of heapless data structures, even without the "each". But I'm not a native speaker either.


If you are seriously constrained by memory, a `Vec<T, 28>` (equivalent to `Vec<T, 28, usize>`) can become a `Vec<T, 28, u8>`, saving up to 7 bytes per `Vec`. This is not much, but in very small microcontrollers, it can make the difference between a program that uses all the memory available and one that just fits.

This release was made possible by [@sgued] and [@zeenix] joining the embedded working group as part of the libs team to help maintain `heapless`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to attributing. 🙏 This should probably either go under another heading (e.g "Contributors") or separated from the previous paragraph through a ruler (---).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made it its own section and credited other contributors too.

@sgued sgued force-pushed the heapless-release-091 branch from ad703cd to 55849f7 Compare August 20, 2025 07:22
@sgued sgued force-pushed the heapless-release-091 branch 2 times, most recently from 2478737 to 136e4d3 Compare August 20, 2025 09:48
@sgued sgued force-pushed the heapless-release-091 branch from 136e4d3 to 96a881e Compare August 20, 2025 10:09
@sgued
Copy link
Contributor Author

sgued commented Aug 20, 2025

Can we merge this this evening? It'd be nice to have it in tomorrow's this week in Rust

@adamgreig adamgreig merged commit 4160fa2 into rust-embedded:master Aug 20, 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.

4 participants