use std::fs::File;
use std::io::{self, BufRead};
use std::path::Path;
pub fn read_lines
(filename: P) -> io::Result>>
where
P: AsRef,
{
let file = File::open(filename)?;
Ok(io::BufReader::new(file).lines())
}
pub fn read_without_lines(filename: P) -> Result
where
P: AsRef,
{
let lines = read_lines(filename)?;
Ok(lines.fold(String::new(), |acc, line| acc + &line.unwrap()))
}