From 8af7c47fe53cd90f517879b837261bb3c02a5ea0 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Sat, 21 Mar 2020 14:33:51 -0500 Subject: [PATCH] refactor: SImplify init --- src/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0ee2f4a2..65633f6f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -468,12 +468,11 @@ fn run() -> Result { init_logging(args.verbose.log_level()); - let mut config = config::Config::default(); - if let Some(path) = args.custom_config.as_ref() { - let custom = config::Config::from_file(path)?; - config.update(&custom); - } - let config = config; + let config = if let Some(path) = args.custom_config.as_ref() { + config::Config::from_file(path)? + } else { + config::Config::default() + }; let mut typos_found = false; let mut errors_found = false;