usestd::fs::File;usestd::io::{self, BufRead};usestd::path::Path;// The output is wrapped in a Result to allow matching on errors.
// Returns an Iterator to the Reader of the lines of the file.
pubfnread_lines<P>(filename: P)->io::Result<io::Lines<io::BufReader<File>>>where
P:AsRef<Path>,
{let file =File::open(filename)?;Ok(io::BufReader::new(file).lines())}