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

Remove StrBuf #280

Merged
merged 1 commit into from
Oct 12, 2023
Merged

Remove StrBuf #280

merged 1 commit into from
Oct 12, 2023

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Oct 11, 2023

StrBuf has two responsibilities:

  • StrBuf is mostly used to turn a *const u8 into a &str. While this is completely unsafe to do, using the same assumptions it's much more efficient to turn the pointer into a slice instead of copying the string.
  • StrBuf is used as a string builder. The string is assembled in a local buffer, then copied to the destination pointer unconditionally. I've replaced this with direct writing into the destination pointer.

@bugadani bugadani force-pushed the strbuf branch 6 times, most recently from 8a0156e to 95e270b Compare October 11, 2023 14:04
@bugadani bugadani marked this pull request as ready for review October 11, 2023 14:12
Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

LGTM

@bjoernQ bjoernQ merged commit 289b709 into esp-rs:main Oct 12, 2023
7 checks passed
@bugadani bugadani deleted the strbuf branch October 12, 2023 07:19
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