From 7d7b9e95a9b7fe71e7bb42b08a22698475a9c78c Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 11 Nov 2020 16:36:48 +0100 Subject: [PATCH] Simplify and_then(Some) as map() and remove move --- src/api/s3_list.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/s3_list.rs b/src/api/s3_list.rs index 9e6bc0f5..f2b49a1d 100644 --- a/src/api/s3_list.rs +++ b/src/api/s3_list.rs @@ -66,7 +66,7 @@ pub async fn handle_list( let relative_key = &object.key[prefix.len()..]; relative_key .find(delimiter) - .and_then(move |i| Some(&object.key[..prefix.len() + i + delimiter.len()])) + .map(|i| &object.key[..prefix.len() + i + delimiter.len()]) } else { None };