Simplify and_then(Some) as map() and remove move

This commit is contained in:
Alex Auvolat 2020-11-11 16:36:48 +01:00
parent 5a5592c176
commit 7d7b9e95a9

View File

@ -66,7 +66,7 @@ pub async fn handle_list(
let relative_key = &object.key[prefix.len()..]; let relative_key = &object.key[prefix.len()..];
relative_key relative_key
.find(delimiter) .find(delimiter)
.and_then(move |i| Some(&object.key[..prefix.len() + i + delimiter.len()])) .map(|i| &object.key[..prefix.len() + i + delimiter.len()])
} else { } else {
None None
}; };