summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Thiel <sthiel@thoughtworks.com>2019-06-01 11:30:43 +0530
committerSebastian Thiel <sthiel@thoughtworks.com>2019-06-01 11:30:59 +0530
commita19e3d76fe559f59be467b4967156509e6f26715 (patch)
tree4107c18b14d6ec63c5470a05957270f488d4c05c
parent61ca52a2a8b23daffc3eea1fe8d71078e757a0d3 (diff)
By not counting directories, we get the correct amount of bytes
-rw-r--r--src/lib.rs3
-rw-r--r--tests/snapshots/success-no-arguments2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 3535952..ca84134 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -42,7 +42,8 @@ mod aggregate {
match entry {
Ok(entry) => {
num_bytes += match entry.metadata {
- Some(Ok(m)) => m.len(),
+ Some(Ok(ref m)) if !m.is_dir() => m.len(),
+ Some(Ok(_)) => 0,
Some(Err(_)) => {
res.num_errors += 1;
0
diff --git a/tests/snapshots/success-no-arguments b/tests/snapshots/success-no-arguments
index d47bfb4..884864b 100644
--- a/tests/snapshots/success-no-arguments
+++ b/tests/snapshots/success-no-arguments
@@ -1 +1 @@
-1259683 . \ No newline at end of file
+1258947 . \ No newline at end of file