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

Expose bullet_stream::strip_ansi #11

Merged
merged 2 commits into from
Oct 13, 2024
Merged

Expose bullet_stream::strip_ansi #11

merged 2 commits into from
Oct 13, 2024

Conversation

schneems
Copy link
Collaborator

I already had to write it for the Ruby buildpack (https://github.com/heroku/buildpacks-ruby/blob/c8cdfd0be3a61f7b50d36cae12ec3d22f8068afc/buildpacks/ruby/src/layers/shared.rs#L146), it's useful to have here, and it's useful to show the result of an output in tests like #10.

I already had to write it for the Ruby buildpack (https://github.com/heroku/buildpacks-ruby/blob/c8cdfd0be3a61f7b50d36cae12ec3d22f8068afc/buildpacks/ruby/src/layers/shared.rs#L146), it's useful to have here, and it's useful to show the result of an output in tests like #10.
@schneems schneems force-pushed the schneems/pub-strip-ansi branch from 8fae7bf to f1c91af Compare October 10, 2024 19:27
We know that the string that is produced will be at MOST the same size as the &str passed in. If we allocate that up-front then we avoid potentially needing to allocate several times while iterating over the chars.

It's not required in any way shape or form, but since we can do it and it's easy enough, why not!
@schneems schneems merged commit 929f36d into main Oct 13, 2024
4 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.

1 participant