aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorUMTS at Teleco <crt@teleco.ch>2026-03-08 22:11:52 +0100
committerUMTS at Teleco <crt@teleco.ch>2026-03-08 22:11:52 +0100
commit17c6bd803dbbecb8975b1b98532d25a807a7b3fb (patch)
treebc0e339ca514414261ce211ab0f74101e6d8aefa /src/main.rs
parentee17cec85d3d9ef2abc0d7a50c980d82b429b59d (diff)
docs and font fix
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs41
1 files changed, 35 insertions, 6 deletions
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<ErrorKind> = config.settings.noretry.iter()
+ let noretry: Vec<ErrorKind> = 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<String>) {
}
}
-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<AggregatedResult>) -> Vec<DomainR
});
aggregated.into_iter().map(|item| item.result).collect()
}
-