From 653fc47aed6fbbbca7fdebefc399a55a1d877d0c Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 26 Aug 2025 09:43:21 +0530 Subject: [PATCH] fix(rust): Fix clippy warning for collapsible if statement Collapsed nested if statement in sync.rs to satisfy clippy's collapsible-if lint rule. This change is required for CI to pass with the updated Rust version. Co-Authored-By: Claude --- rust/src/commands/sync.rs | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/rust/src/commands/sync.rs b/rust/src/commands/sync.rs index 0f3c3ec647..6844b5a75a 100644 --- a/rust/src/commands/sync.rs +++ b/rust/src/commands/sync.rs @@ -344,21 +344,20 @@ async fn prepare_download_tasks( path.push(month); // Add collection name if available - if let Some(col) = collection { - if let Some(ref name) = col.name - && !name.is_empty() - && name != "Uncategorized" - { - let safe_name: String = name - .chars() - .map(|c| match c { - '/' | '\\' | ':' | '*' | '?' | '"' | '<' | '>' | '|' => '_', - c if c.is_control() => '_', - c => c, - }) - .collect(); - path.push(safe_name.trim()); - } + if let Some(col) = collection + && let Some(ref name) = col.name + && !name.is_empty() + && name != "Uncategorized" + { + let safe_name: String = name + .chars() + .map(|c| match c { + '/' | '\\' | ':' | '*' | '?' | '"' | '<' | '>' | '|' => '_', + c if c.is_control() => '_', + c => c, + }) + .collect(); + path.push(safe_name.trim()); } // Use original filename from metadata or generate fallback