1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
type File = String; fn open(f: &mut File) { } fn close(f: &mut File) { } fn read(f: &mut File, save_to: &mut Vec<u8>) { } fn main() { let mut file1 = File::from("file1.txt"); open(&mut file1); //read(file1, vec![]); close(&mut file1); } // left off at listing 3.1