]>
git.proxmox.com Git - rustc.git/blob - src/doc/book/listings/ch09-error-handling/listing-09-08/src/main.rs
6 fn read_username_from_file() -> Result
<String
, io
::Error
> {
7 let mut username
= String
::new();
9 File
::open("hello.txt")?
.read_to_string(&mut username
)?
;
16 let username
= read_username_from_file().expect("Unable to get username");