From 872a49bb7de377bfc54f04e1cb1e07f203e68340 Mon Sep 17 00:00:00 2001 From: Bob Date: Tue, 1 Oct 2019 22:35:29 +0100 Subject: [PATCH 1/2] better var name --- src/utils/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/mod.rs b/src/utils/mod.rs index a8f628a..f9a5d5b 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -69,7 +69,7 @@ fn examine_dir( apparent_size: bool, inodes: &mut HashSet<(u64, u64)>, data: &mut HashMap, - permissions: &mut u64, + file_count_no_permission: &mut u64, ) { for entry in WalkDir::new(top_dir) { if let Ok(e) = entry { @@ -97,7 +97,7 @@ fn examine_dir( e_path.pop(); } } - None => *permissions += 1, + None => *file_count_no_permission += 1, } } } From d46b63fad89dff63854c24bf1075033174eb955f Mon Sep 17 00:00:00 2001 From: Bob Date: Tue, 1 Oct 2019 22:44:17 +0100 Subject: [PATCH 2/2] Add detection of files which fail permission Old code caught some file permission denied but not all. --- src/utils/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/mod.rs b/src/utils/mod.rs index f9a5d5b..e33f08d 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -99,6 +99,8 @@ fn examine_dir( } None => *file_count_no_permission += 1, } + } else { + *file_count_no_permission += 1 } } }