use std::fs::File; use std::io; use std::io::Read; use std::path::Path; /// Read a file to string pub fn read_file>(path: P) -> io::Result { let path = path.as_ref(); let mut file = File::open(path)?; let mut buf = String::new(); file.read_to_string(&mut buf)?; Ok(buf) }