Add example using std::io::Write#261
Conversation
|
For the testing, I used |
mxinden
left a comment
There was a problem hiding this comment.
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.
| 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.
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. |
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