From 8c76c6a3c851ed6fe1cf245a8d0e3af5c088f048 Mon Sep 17 00:00:00 2001 From: Valentin Bersier Date: Wed, 18 Jan 2023 08:00:53 +0100 Subject: [PATCH] refactor: simplify iterator to get size --- src/output.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/output.rs b/src/output.rs index 2f9e1b6..2d635e8 100644 --- a/src/output.rs +++ b/src/output.rs @@ -151,8 +151,7 @@ pub fn print(duplicates: DashMap>, opts: &Params) { // we extract the file size of the first file in the group let size = f.1.first() - .and_then(|ff| Some(&ff.path)) - .and_then(|p| fs::metadata(p).ok()) + .and_then(|ff| fs::metadata(&ff.path).ok()) .and_then(|m| Some(m.len())); (f.0, f.1, size) })