From f9a16005133e184cf43385ca7e5c6bc795dedb65 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 7 Aug 2019 10:32:53 -0500 Subject: [PATCH] refactor( Push out options --- src/main.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 29add46..48adff5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -262,21 +262,16 @@ fn run() -> Result { let mut builder = get_logging(options.verbose.log_level()); builder.init(); - let check_filenames = options.check_filenames().unwrap_or(true); - let check_files = options.check_files().unwrap_or(true); - let ignore_hex = options.ignore_hex().unwrap_or(true); - let binary = options.binary().unwrap_or(false); - let dictionary = typos::BuiltIn::new(); let parser = typos::tokens::ParserBuilder::new() - .ignore_hex(ignore_hex) + .ignore_hex(options.ignore_hex().unwrap_or(true)) .build(); let checks = typos::checks::CheckSettings::new() - .check_filenames(check_filenames) - .check_files(check_files) - .binary(binary) + .check_filenames(options.check_filenames().unwrap_or(true)) + .check_files(options.check_files().unwrap_or(true)) + .binary(options.binary().unwrap_or(false)) .build(&dictionary, &parser); let mut config = config::Config::default();