macro_rules! read_line_of_vars {
($type:ty, $lines:ident, $($var:ident),+) => { ... };
}Expand description
Reads a sample line from the previously fetched vector of lines, then parses a heterogeneous sequence of variables and stores them in previously allocated memory.
ยงExamples
use concise_scanf_like_input::read_line_of_vars;
let mut lines: &[&str] = &vec!["1", "2 3"];
// you don't need to make a variable mutable
let t: i32;
read_line_of_vars!(i32, lines, t);
for _ in 0..t {
let (n, x): (i32, i32);
read_line_of_vars!(i32, lines, n, x);
}