{ Ok(contents) => println!("{}", contents), Err(e) => panic!("OH, NO! {}", e), } } fn do_magic_stuff() -> Result<String, io::Error> { let mut boring = match File::open("boring.txt") { Ok(f) => f, Err(e) => return Err(e), }; let mut fun = match File::open("fun.txt") { Ok(f) => f, Err(e) => return Err(e), }; let mut contents = String::new(); boring.read_to_string(&mut contents); fun.read_to_string(&mut contents); return Ok(contents); }