aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_list.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/s3_list.rs')
-rw-r--r--src/api/s3_list.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/api/s3_list.rs b/src/api/s3_list.rs
index 0a3b62ec..f2b49a1d 100644
--- a/src/api/s3_list.rs
+++ b/src/api/s3_list.rs
@@ -64,10 +64,9 @@ pub async fn handle_list(
}
let common_prefix = if delimiter.len() > 0 {
let relative_key = &object.key[prefix.len()..];
- match relative_key.find(delimiter) {
- Some(i) => Some(&object.key[..prefix.len() + i + delimiter.len()]),
- None => None,
- }
+ relative_key
+ .find(delimiter)
+ .map(|i| &object.key[..prefix.len() + i + delimiter.len()])
} else {
None
};