diff options
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))?; |
