diff options
| author | UMTS at Teleco <crt@teleco.ch> | 2026-03-08 22:11:52 +0100 |
|---|---|---|
| committer | UMTS at Teleco <crt@teleco.ch> | 2026-03-08 22:11:52 +0100 |
| commit | 17c6bd803dbbecb8975b1b98532d25a807a7b3fb (patch) | |
| tree | bc0e339ca514414261ce211ab0f74101e6d8aefa /src/output.rs | |
| parent | ee17cec85d3d9ef2abc0d7a50c980d82b429b59d (diff) | |
docs and font fix
Diffstat (limited to 'src/output.rs')
| -rw-r--r-- | src/output.rs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/output.rs b/src/output.rs index 6a02f32..32198f4 100644 --- a/src/output.rs +++ b/src/output.rs @@ -57,9 +57,19 @@ pub fn print_full_table(results: &[DomainResult], no_color: bool, no_unicode: bo } // calc column widths - let domain_w = results.iter().map(|r| r.full.len()).max().unwrap_or(10).max(7); + let domain_w = results + .iter() + .map(|r| r.full.len()) + .max() + .unwrap_or(10) + .max(7); let status_w = 10; // "registered" is the longest - let note_w = results.iter().map(|r| r.note_str().len()).max().unwrap_or(4).max(4); + let note_w = results + .iter() + .map(|r| r.note_str().len()) + .max() + .unwrap_or(4) + .max(4); let domain_col = domain_w + 2; let status_col = status_w + 2; @@ -167,10 +177,9 @@ pub fn print_csv(results: &[DomainResult]) { } pub fn write_csv_file(results: &[DomainResult], path: &PathBuf) -> Result<(), String> { - let mut file = std::fs::File::create(path) - .map_err(|e| format!("Could not create CSV file: {}", e))?; - writeln!(file, "Domains, Status, Note") - .map_err(|e| format!("Write error: {}", e))?; + let mut file = + std::fs::File::create(path).map_err(|e| format!("Could not create CSV file: {}", e))?; + writeln!(file, "Domains, Status, Note").map_err(|e| format!("Write error: {}", e))?; for r in results { writeln!(file, "{}, {}, {}", r.full, r.status_str(), r.note_str()) .map_err(|e| format!("Write error: {}", e))?; |
