open file error handling
examples/files/open-file-handling/src/main.rs
fn main() { //let res = this_or_that(); //println!("{:?}", res); } fn this_or_that() -> Option // // //use std::fs::File; //use std::io; // // //fn main() -> Result<String, io::Error> { // let filename = "README.md"; // //let res = File::open(filename); // return Ok() and the Filehandle inside it // //println!("{:?}", res); // // //let res = File::open(filename).unwrap(); // returns the Filehandle // //println!("{:?}", res); // // let res = File::open(filename)?; // the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) // println!("{:?}", res); // Ok(("ok")) //}