From 17c6bd803dbbecb8975b1b98532d25a807a7b3fb Mon Sep 17 00:00:00 2001 From: UMTS at Teleco Date: Sun, 8 Mar 2026 22:11:52 +0100 Subject: docs and font fix --- src/main.rs | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index aa0b993..9625959 100644 --- a/src/main.rs +++ b/src/main.rs @@ -98,13 +98,26 @@ async fn main() { let overrides = whois_overrides(); // parse noretry config into ErrorKind list - let noretry: Vec = config.settings.noretry.iter() + let noretry: Vec = config + .settings + .noretry + .iter() .filter_map(|s| ErrorKind::from_config_str(s)) .collect(); // TUI mode if args.is_tui() { - if let Err(e) = tui::run_tui(&args, &config, paths.clone(), cache_file.clone(), force_refresh, overrides.clone(), noretry.clone()).await { + if let Err(e) = tui::run_tui( + &args, + &config, + paths.clone(), + cache_file.clone(), + force_refresh, + overrides.clone(), + noretry.clone(), + ) + .await + { eprintln!("TUI error: {}", e); } // save cache timestamp after TUI session if we refreshed @@ -118,7 +131,15 @@ async fn main() { // CLI needs at least one domain unless autosearch was given if args.domains.is_empty() { if let Some(file_path) = &args.autosearch { - run_autosearch(&args, file_path, cache_file.as_deref(), force_refresh, overrides, &noretry).await; + run_autosearch( + &args, + file_path, + cache_file.as_deref(), + force_refresh, + overrides, + &noretry, + ) + .await; if force_refresh && paths.can_save { config.mark_cache_updated(); let _ = config.save(&paths.config_file); @@ -392,7 +413,10 @@ fn parse_domain_input(raw_domain: &str) -> (String, Option) { } } -fn build_effective_tlds(base_tlds: &[&'static str], specific_tld: Option<&str>) -> Vec<&'static str> { +fn build_effective_tlds( + base_tlds: &[&'static str], + specific_tld: Option<&str>, +) -> Vec<&'static str> { if let Some(tld) = specific_tld { vec![Box::leak(tld.to_string().into_boxed_str()) as &'static str] } else { @@ -403,7 +427,13 @@ fn build_effective_tlds(base_tlds: &[&'static str], specific_tld: Option<&str>) fn estimate_total_lookups(domains: &[String], base_tlds: &[&'static str]) -> usize { domains .iter() - .map(|domain| if domain.contains('.') { 1 } else { base_tlds.len() }) + .map(|domain| { + if domain.contains('.') { + 1 + } else { + base_tlds.len() + } + }) .sum() } @@ -415,4 +445,3 @@ fn sort_aggregated_results(mut aggregated: Vec) -> Vec