Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std example cosmetics #3702

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

BartMassey
Copy link
Contributor

Did some minor cosmetic cleanups to the README and demo in examples/std.

@BartMassey BartMassey force-pushed the std-example-cosmetics branch from 98b6d98 to 76bc7ed Compare January 1, 2025 00:12

/// In a `no_std` situation it is useful to be able to
/// format into a fixed-size buffer using the
/// `core::fmt::write` macro. This struct enables that.
Copy link
Member

@Dirbaio Dirbaio Jan 1, 2025

Choose a reason for hiding this comment

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

this is a bit too complex for an example, i'd suggest using heapless::String instead. you can write! into it just like WriteBuf.

(or just give up on nostd and use format!, since this example is for std. I do think it's nice to keep things copypastable to nostd code tho)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doh. Hadn't noticed we were already depending on heapless and was trying to avoid it. Thanks for the catch. Fixed.

@BartMassey BartMassey force-pushed the std-example-cosmetics branch from 76bc7ed to b5ef53a Compare January 2, 2025 00:35
@Dirbaio
Copy link
Member

Dirbaio commented Jan 2, 2025

thanks!

@Dirbaio Dirbaio added this pull request to the merge queue Jan 2, 2025
Merged via the queue into embassy-rs:main with commit 87b4d94 Jan 2, 2025
7 checks 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.

2 participants