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()]); + } } } }