lines_writer 0.1.1

A simple trait to write into a `Write`r any iterator of `Display` items
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented1 out of 3 items with examples
  • Size
  • Source code size: 11.81 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.06 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • garro95/lines_writer
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • garro95

lines_writer

This crate lets you write an iterator into a LinesWriter, with each item on a line.

The trait LinesWriter is implemented for all the types that implement std::io::Write. Simply call write_lines on the writer and pass an iterator as argument.

Examples

use lines_writer::LinesWriter;

fn main() {
    let str = "This is\na string\nto show\nhow do\nthis work";
    std::io::stdout().write_lines(str.lines()).unwrap();
}
use lines_writer::LinesWriter;

fn main() {
    let array = [10, 15, 63, 29];
    std::io::stdout().write_lines(&array).unwrap();
}

Contributing

Feel free to contribute to this project with pull requests and/or issues. All contribution should be under a license compatible with the GNU LGPLv3.

Changes

0.1.0 First release