Minor cleanup in main()
This commit is contained in:
parent
8af19c3f0c
commit
0f1c742857
12
src/main.rs
12
src/main.rs
|
@ -33,9 +33,8 @@ use alacritty::tty::{self, process_should_exit};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Load configuration
|
// Load configuration
|
||||||
let config = match Config::load() {
|
let config = Config::load().unwrap_or_else(|err| {
|
||||||
// Error loading config
|
match err {
|
||||||
Err(err) => match err {
|
|
||||||
// Use default config when not found
|
// Use default config when not found
|
||||||
config::Error::NotFound => {
|
config::Error::NotFound => {
|
||||||
err_println!("Config file not found; using defaults");
|
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
|
// If there's a problem with the config file, print an error
|
||||||
// and exit.
|
// and exit.
|
||||||
_ => die!("{}", err),
|
_ => die!("{}", err),
|
||||||
},
|
}
|
||||||
|
});
|
||||||
// Successfully loaded config from file
|
|
||||||
Ok(config) => config
|
|
||||||
};
|
|
||||||
|
|
||||||
// Load command line options
|
// Load command line options
|
||||||
let options = cli::Options::load();
|
let options = cli::Options::load();
|
||||||
|
|
Loading…
Reference in New Issue