diff --git a/src/output.rs b/src/output.rs index 2d635e8..3bd0e8a 100644 --- a/src/output.rs +++ b/src/output.rs @@ -152,7 +152,8 @@ pub fn print(duplicates: DashMap>, opts: &Params) { let size = f.1.first() .and_then(|ff| fs::metadata(&ff.path).ok()) - .and_then(|m| Some(m.len())); + .and_then(|m| Some(m.len())) + .unwrap_or_default(); (f.0, f.1, size) }) .sorted_unstable_by_key(|f| f.2) // sort by ascending size @@ -164,7 +165,7 @@ pub fn print(duplicates: DashMap>, opts: &Params) { format_path(&file.path, opts).unwrap_or_default().blue(), // since all files should logically have the same size, // we can print the pre-computed size of the first element in the group - format!("{:>12}", format_size(size.unwrap_or_default(), DECIMAL)).red(), + format!("{:>12}", format_size(size, DECIMAL)).red(), modified_time(&file.path).unwrap_or_default().yellow() ]); });