]>
git.proxmox.com Git - rustc.git/blob - src/doc/book/listings/ch09-error-handling/listing-09-05/src/main.rs
2 use std
::io
::ErrorKind
;
5 let f
= File
::open("hello.txt");
9 Err(error
) => match error
.kind() {
10 ErrorKind
::NotFound
=> match File
::create("hello.txt") {
12 Err(e
) => panic
!("Problem creating the file: {:?}", e
),
15 panic
!("Problem opening the file: {:?}", other_error
)