diff options
author | Joe Wilm <joe@jwilm.com> | 2016-12-27 22:47:25 -0500 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-12-27 22:47:25 -0500 |
commit | 0f1c742857b43565623932a5aa469ded2f1ad6dd (patch) | |
tree | fec4834fc74c99ada6523c5b13b913bd843cf6fc /src/main.rs | |
parent | 8af19c3f0cf0950f8a9bcc664448817e443d07ad (diff) | |
download | alacritty-0f1c742857b43565623932a5aa469ded2f1ad6dd.tar.gz alacritty-0f1c742857b43565623932a5aa469ded2f1ad6dd.zip |
Minor cleanup in main()
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs index aceb9659..fb58b461 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,9 +33,8 @@ use alacritty::tty::{self, process_should_exit}; fn main() { // Load configuration - let config = match Config::load() { - // Error loading config - Err(err) => match err { + let config = Config::load().unwrap_or_else(|err| { + match err { // Use default config when not found config::Error::NotFound => { err_println!("Config file not found; using defaults"); @@ -45,11 +44,8 @@ fn main() { // If there's a problem with the config file, print an error // and exit. _ => die!("{}", err), - }, - - // Successfully loaded config from file - Ok(config) => config - }; + } + }); // Load command line options let options = cli::Options::load(); |