diff options
Diffstat (limited to 'src/doc/book/listings/ch09-error-handling/listing-09-12/src/main.rs')
-rw-r--r-- | src/doc/book/listings/ch09-error-handling/listing-09-12/src/main.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/doc/book/listings/ch09-error-handling/listing-09-12/src/main.rs b/src/doc/book/listings/ch09-error-handling/listing-09-12/src/main.rs new file mode 100644 index 000000000..b0f7445f4 --- /dev/null +++ b/src/doc/book/listings/ch09-error-handling/listing-09-12/src/main.rs @@ -0,0 +1,8 @@ +use std::error::Error; +use std::fs::File; + +fn main() -> Result<(), Box<dyn Error>> { + let greeting_file = File::open("hello.txt")?; + + Ok(()) +} |