use std::{io::prelude::*, fs::File, path::Path, io }; fn main() { } fn load_data(file_name: &str) -> String { let mut file = match File::open(Path::new(file_name)) { Ok(file) => file, Err(why) => panic!("Could not open file {}: {}", Path::new(file_name).display(), why), }; let mut s = String::new(); let file_contents = match file.read_to_string(&mut s) { Err(why) => panic!("couldn't read {}: {}", Path::new(file_name).display(), why), Ok(_) => s, }; return file_contents; }