macro_rules! read_input_lines {
($buf:ident) => { ... };
}Expand description
Reads a sample input into a buffer, separating the the lines from each other. On Unix, one needs to enter C-D to mark the end of input.
ยงExamples
use concise_scanf_like_input::read_input_lines;
use std::io::{self, Read, Write};
// you need to make the buffer mutable to allow the macro to fill it
let mut buf = String::new();
// the lines must be mutable to rewind themselves on every new line read
let mut lines: &[&str] = read_input_lines!(buf);