much nicer output

This commit is contained in:
Lynne Megido 2021-02-05 23:49:36 +10:00
parent 5f36f663fc
commit b92ceabfe2
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90

View file

@ -101,7 +101,7 @@ fn main() {
.filter(|e| !e.file_type().is_dir()) // remove directories from the final list .filter(|e| !e.file_type().is_dir()) // remove directories from the final list
.collect(); .collect();
info!("Found {} items to check", entries.len()); trace!("Found {} items to check", entries.len());
let results: Vec<Result<Findings, PathBuf>> = entries let results: Vec<Result<Findings, PathBuf>> = entries
.par_iter() .par_iter()
@ -148,7 +148,13 @@ fn main() {
for result in results { for result in results {
match result { match result {
Ok(r) => trace!("{:#?}: {:#?} - {:?} - {:?}", r.file, r.mime, r.valid, r.recommended_extension()), Ok(r) => {
if !r.valid {
info!("{:?} should have file extension {}", r.file, r.recommended_extension().unwrap())
} else {
trace!("{:?} is totally fine", r.file)
}
}
Err(f) => warn!("{:#?}: Error 0uo", f) Err(f) => warn!("{:#?}: Error 0uo", f)
} }
} }