use std::env::args; use std::fs::File; use std::io::BufRead; use std::io::BufReader; pub fn iter_input() -> impl Iterator { let path = args().nth(1).unwrap(); let file = File::open(path).unwrap(); return BufReader::new(file).lines().map(|l| l.unwrap()); } #[allow(dead_code)] pub fn split_once(s: &str, sep: char) -> Option<(&str, &str)> { let x = s.find(sep)?; return Some((&s[..x], &s[x+1..])); }