use std::io::BufRead; mod a1; mod a2; fn read_file(path :&str) -> Vec { let file = std::fs::File::open(path); return match file { Ok(handle) => { let reader = std::io::BufReader::new(handle); let mut vec : Vec = vec![]; reader.lines().for_each(|elem| { vec.push(elem.unwrap()); }); vec } Err(_) => vec![] } } fn main() { let inp :Vec = read_file("input.txt"); a1::run(inp.clone()); a2::run(inp); }