Newer
Older
use std::{cell::RefCell, fs::File, io::Read, rc::Rc};
pub type SharedMut<T> = Rc<RefCell<T>>;
let mut file = match File::open(path) {
Ok(file) => file,
Err(_) => panic!("Failed to open file: {}", path),
};
let mut data = Vec::new();
file.read_to_end(&mut data).unwrap();
data
}