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 <noreply@anthropic.com>
This commit is contained in:
Manav Rathi
2025-08-26 09:43:21 +05:30
parent 34325691e7
commit 653fc47aed

View File

@@ -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