From 5784fb22837a5e64ac4908580ff9f7306d80fcf6 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 22 Oct 2024 12:30:27 +0300 Subject: [PATCH] filelist-fix --- src/s3_utils.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/s3_utils.rs b/src/s3_utils.rs index 3680196..46833a6 100644 --- a/src/s3_utils.rs +++ b/src/s3_utils.rs @@ -96,10 +96,10 @@ pub async fn get_s3_filelist(client: &S3Client, bucket: &str) -> Vec<[std::strin let mut parts = filepath.split('/').collect::>(); // Explicit type annotation let filename = parts.pop().unwrap(); let mut filename_parts = filename.split('.').collect::>(); - let _ext = filename_parts.pop().unwrap(); - let filekey = filename_parts.pop().unwrap(); - - filekeys.push([filekey.to_string(), s3_filepath.to_string()]); + let _ext = filename_parts.pop().unwrap_or_default(); + if let Some(filekey) = filename_parts.pop() { + filekeys.push([filekey.to_string(), s3_filepath.to_string()]); + } } } }