~janbaudisch/aoc-2020

43ae9f588f80825416304639c4f367e5a9b3c27e — Jan Baudisch 11 months ago deac177
common: add block input reading
1 files changed, 16 insertions(+), 0 deletions(-)

M common/src/input.rs
M common/src/input.rs => common/src/input.rs +16 -0
@@ 40,3 40,19 @@ pub fn read_lines() -> Vec<String> {

    lines
}

pub fn read_blocks() -> Vec<Vec<String>> {
    let mut blocks: Vec<Vec<String>> = Vec::new();

    loop {
        let block = read_lines();

        if block.is_empty() {
            break;
        }

        blocks.push(block);
    }

    blocks
}