minor ui improvements

This commit is contained in:
sreedevk
2025-07-19 11:43:26 +00:00
parent c0286b17cc
commit 4894d1b4db

View File

@@ -34,32 +34,31 @@ impl Formatter {
}
pub fn print(raw: Arc<DashMap<u128, Vec<FileInfo>>>, max_path_len: u64, aargs: &Params) {
print!("\n\n\n"); // spacing
print!("{}", "\n".repeat(if aargs.progress { 2 } else { 1 })); // spacing
if raw.is_empty() {
println!("No duplicates found matching your search criteria.");
return;
} else {
raw.par_iter().for_each(|sref| {
let mut ostring = format!("{}{:32x}{}\n", YELLOW, sref.key(), RESET);
let subfields = sref
.value()
.par_iter()
.map(|finfo| {
format!(
"├─ {}\t{}\t{}\n",
Self::human_path(finfo, aargs, max_path_len as usize)
.expect("path formatting failed."),
Self::human_filesize(finfo).expect("filesize formatting failed."),
Self::human_mtime(finfo).expect("modified time formatting failed.")
)
})
.collect::<String>();
ostring.push_str(&subfields);
println!("{ostring}");
});
}
raw.par_iter().for_each(|sref| {
let mut ostring = format!("{}{:32x}{}\n", YELLOW, sref.key(), RESET);
let subfields = sref
.value()
.par_iter()
.map(|finfo| {
format!(
"├─ {}\t{}\t{}\n",
Self::human_path(finfo, aargs, max_path_len as usize)
.expect("path formatting failed."),
Self::human_filesize(finfo).expect("filesize formatting failed."),
Self::human_mtime(finfo).expect("modified time formatting failed.")
)
})
.collect::<String>();
ostring.push_str(&subfields);
println!("{ostring}");
});
}
}