-
Notifications
You must be signed in to change notification settings - Fork 106
Add example using std::io::Write #261
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
Conversation
|
For the testing, I used |
mxinden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Small comment. Otherwise looks good to me. Thanks for the help!
examples/io_write.rs
Outdated
| pub struct IoWriterWrapper<W>(W) | ||
| where | ||
| W: Write; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| pub struct IoWriterWrapper<W>(W) | |
| where | |
| W: Write; | |
| pub struct IoWriterWrapper<W>(W); |
Is the bound needed in the struct definition? It should only be needed in the std::fmt::Write implementation below.
examples/io_write.rs
Outdated
| /// Example showing how one could write to a file or socket instead of a string. | ||
| /// For large metrics registries this will be more memory efficient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would assume a module comment would be more appropriate. Feel free to ignore.
| /// Example showing how one could write to a file or socket instead of a string. | |
| /// For large metrics registries this will be more memory efficient | |
| //! Example showing how one could write to a file or socket instead of a string. | |
| //! For large metrics registries this will be more memory efficient. |
|
Please address the CI failures. |
|
Thanks all! I’m happy with whatever changes were needed.
|
|
@RandomInsano just to avoid any confusion, you would need to make the above changes and then push another commit or amend your existing commit. Of course, there is no rush. |
|
Thanks for the clarification! Code is pushed now. Verified the code still compiles and the assert still passes. |
Signed-off-by: Edwin Amsler <[email protected]>
|
Missed the DCO failure. Decided to squash and force a new commit. |
mxinden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done. Thanks.
Help users learn how to directly write data to an object implementing
std::io::Write.Doing some tests with 1,000 counters:
Closes out #258