From 2bc88418f5d05ca3a71d0f4fa1df767e56920682 Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Fri, 4 Sep 2026 12:06:34 +0800 Subject: [PATCH] fix(list): satisfy clippy in the source listing merge (#7117) --- rustfs/src/app/bucket_list_through.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rustfs/src/app/bucket_list_through.rs b/rustfs/src/app/bucket_list_through.rs index fe883d913..02c4c7420 100644 --- a/rustfs/src/app/bucket_list_through.rs +++ b/rustfs/src/app/bucket_list_through.rs @@ -336,7 +336,7 @@ async fn fetch_source_page( delimiter: params.delimiter.as_deref(), // S3 ignores start-after once a continuation token is present, so // the client's own start-after only applies to the first page. - start_after: token.is_none().then(|| params.start_after_for_query.as_deref()).flatten(), + start_after: token.is_none().then_some(params.start_after_for_query.as_deref()).flatten(), continuation_token: token, max_keys: params.max_keys, }, @@ -363,9 +363,11 @@ async fn fetch_source_page( SourceListPlan::Folded { common_prefix, .. } => { let exists = !page.objects.is_empty() || !page.common_prefixes.is_empty(); Ok(( - exists - .then(|| vec![SideEntry::Prefix(common_prefix.clone())]) - .unwrap_or_default(), + if exists { + vec![SideEntry::Prefix(common_prefix.clone())] + } else { + Vec::new() + }, false, None, ))