-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Optionally write to a buffer instead of stdout #2618
Conversation
Can we please run a simple benchmark (e.g. |
Both compiled in release mode, 5 warmup runs, 20 runs Command used to generate the file: |
Thank you very much!
❤️ |
9fc68ee
to
72e1a40
Compare
I'm just rebasing to current master to see if the tests still pass. |
Following on from my comment in #956, this PR adds the ability to write output to a
std::fmt
buffer instead of stdout. It does this by changing thehandle
used by the printer to be a mutable reference to either one ofdyn fmt::Write
ordyn io::Write
.Included is also an added example to show that it works. I didn't add it to the
PrettyPrinter
but I can do if it seems like a good idea.Anything else let me know!