Skip to content

Commit 19af8a0

Browse files
committed
Fix collapsible if statements in storage crate
1 parent 50deca3 commit 19af8a0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

crates/recrypt-storage/src/local.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ impl ChunkStorage for LocalFileStorage {
9696

9797
let mut entries = fs::read_dir(&chunks_dir).await?;
9898
while let Some(entry) = entries.next_entry().await? {
99-
if let Some(name) = entry.file_name().to_str() {
100-
if let Some(hash) = hash_from_base58(name) {
101-
hashes.push(hash);
102-
}
99+
if let Some(name) = entry.file_name().to_str()
100+
&& let Some(hash) = hash_from_base58(name)
101+
{
102+
hashes.push(hash);
103103
}
104104
}
105105

crates/recrypt-storage/src/s3.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ impl ChunkStorage for S3Storage {
230230
for obj in contents {
231231
if let Some(key) = obj.key {
232232
// Extract hash from key: "chunks/b3/{hash_base58}"
233-
if let Some(hash_b58) = key.strip_prefix(&full_prefix) {
234-
if let Some(hash) = hash_from_base58(hash_b58) {
235-
hashes.push(hash);
236-
}
233+
if let Some(hash_b58) = key.strip_prefix(&full_prefix)
234+
&& let Some(hash) = hash_from_base58(hash_b58)
235+
{
236+
hashes.push(hash);
237237
}
238238
}
239239
}

0 commit comments

Comments
 (0)