Function hltas::write::gen_lines

source ·
pub fn gen_lines<'a, W, It, I>(w: W, lines: I) -> Result<(), GenError>where
    W: Write,
    It: Iterator<Item = &'a Line> + Clone,
    I: IntoIterator<Item = &'a Line, IntoIter = It>,
Expand description

Prints newline-terminated Lines into writer.

Examples

use hltas::types::Line;

let lines = [
    Line::Comment(" Hello World".to_string()),
    Line::Reset { non_shared_seed: 1234 },
];
let mut buf = Vec::new();
hltas::write::gen_lines(&mut buf, &lines).unwrap();
assert_eq!(buf, b"// Hello World\nreset 1234\n");