diff --git a/src/error-handling/try-operator.md b/src/error-handling/try-operator.md index 02ad6d15e9d..049a5d815f9 100644 --- a/src/error-handling/try-operator.md +++ b/src/error-handling/try-operator.md @@ -24,17 +24,15 @@ use std::io::{self, Read}; fn read_username(path: &str) -> Result { let username_file_result = fs::File::open(path); - let mut username_file = match username_file_result { Ok(file) => file, - Err(e) => return Err(e), + Err(err) => return Err(err), }; let mut username = String::new(); - match username_file.read_to_string(&mut username) { Ok(_) => Ok(username), - Err(e) => Err(e), + Err(err) => Err(err), } }