diff options
author | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-01 11:30:43 +0530 |
---|---|---|
committer | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-01 11:30:59 +0530 |
commit | a19e3d76fe559f59be467b4967156509e6f26715 (patch) | |
tree | 4107c18b14d6ec63c5470a05957270f488d4c05c | |
parent | 61ca52a2a8b23daffc3eea1fe8d71078e757a0d3 (diff) |
By not counting directories, we get the correct amount of bytes
-rw-r--r-- | src/lib.rs | 3 | ||||
-rw-r--r-- | tests/snapshots/success-no-arguments | 2 |
2 files changed, 3 insertions, 2 deletions
@@ -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 |