use std::fs::File; use std::io::{prelude::*, BufReader}; pub fn read_file(path: &'static str) -> impl Iterator { let reader = BufReader::new(File::open(path).expect("File not found")); reader .lines() .map(|l| l.expect(&format!("Could not read from file"))) }