aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_list.rs
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2020-11-19 14:39:30 +0100
committerQuentin <quentin@deuxfleurs.fr>2020-11-19 14:39:30 +0100
commitfc427b0b66241785ecd3fe23ec3e4ac72aaed1da (patch)
treeea406de04a7a11c09c6d758ca97ba53fc2bdfbe4 /src/api/s3_list.rs
parent6076d869b14aa38059d54a2dece222ad7b9da3bc (diff)
parent044d7988779aadac9290b58ceb077c1211670aed (diff)
downloadgarage-fc427b0b66241785ecd3fe23ec3e4ac72aaed1da.tar.gz
garage-fc427b0b66241785ecd3fe23ec3e4ac72aaed1da.zip
Merge branch 'master' into feature/website
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
};