aboutsummaryrefslogtreecommitdiff
path: root/src/block/repair.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/block/repair.rs')
-rw-r--r--src/block/repair.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/block/repair.rs b/src/block/repair.rs
index d5e2e168..0e7fe0df 100644
--- a/src/block/repair.rs
+++ b/src/block/repair.rs
@@ -473,10 +473,7 @@ impl BlockStoreIterator {
.data_layout
.data_dirs
.iter()
- .filter_map(|x| match x.state {
- DataDirState::Active { capacity } => Some(capacity),
- _ => None,
- })
+ .filter_map(|x| x.capacity())
.min()
.unwrap_or(0);
@@ -484,10 +481,7 @@ impl BlockStoreIterator {
.data_layout
.data_dirs
.iter()
- .map(|x| match x.state {
- DataDirState::Active { capacity } => capacity,
- _ => min_cap, // approximation
- })
+ .map(|x| x.capacity().unwrap_or(min_cap /* approximation */))
.sum::<u64>() as u128;
let mut cum_cap = 0;