aboutsummaryrefslogtreecommitdiff
path: root/src/block
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-09-05 15:41:36 +0200
committerAlex Auvolat <alex@adnab.me>2023-09-06 16:35:28 +0200
commit3a74844df02b5ecec0b96bfb8b2ff3bcdd33f7f4 (patch)
tree7d42c100fbf610aa8183cb207f5e3f7e40448165 /src/block
parent93114a9747cefa441ebd274f206c09699d051b39 (diff)
downloadgarage-3a74844df02b5ecec0b96bfb8b2ff3bcdd33f7f4.tar.gz
garage-3a74844df02b5ecec0b96bfb8b2ff3bcdd33f7f4.zip
block manager: fix dir_not_empty
Diffstat (limited to 'src/block')
-rw-r--r--src/block/layout.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/block/layout.rs b/src/block/layout.rs
index b119281b..3b529fc0 100644
--- a/src/block/layout.rs
+++ b/src/block/layout.rs
@@ -276,8 +276,7 @@ fn dir_not_empty(path: &PathBuf) -> Result<bool, Error> {
.into_string()
.ok()
.and_then(|hex| hex::decode(&hex).ok())
- .map(|bytes| (2..=4).contains(&bytes.len()))
- .unwrap_or(false)
+ .is_some()
{
return Ok(true);
}