From 1e008244ae2214b71e61d11f65f714ad7d2f52b7 Mon Sep 17 00:00:00 2001 From: LyAhn Date: Sun, 21 Jun 2026 19:38:06 +0100 Subject: [PATCH] fix(db): suppress too_many_arguments clippy lint on count_images --- src-tauri/src/commands.rs | 28 +++++++++++++++++++--------- src-tauri/src/db.rs | 1 + 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 974a32a..fe70668 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -330,7 +330,12 @@ pub async fn add_folders( Ok(paths .into_iter() .map(|path| { - match add_one_folder(app.clone(), db.inner().clone(), watcher.inner().clone(), path) { + match add_one_folder( + app.clone(), + db.inner().clone(), + watcher.inner().clone(), + path, + ) { Ok(AddOutcome::Added(folder)) => FolderAddResult::Added(folder), Ok(AddOutcome::Skipped(folder)) => FolderAddResult::Skipped(folder.path), Err(error) => FolderAddResult::Error(error), @@ -365,13 +370,15 @@ fn path_to_string(path: &Path) -> String { fn directory_has_children(path: &Path) -> bool { std::fs::read_dir(path) - .map(|mut entries| entries.any(|entry| { - entry - .ok() - .and_then(|entry| entry.file_type().ok()) - .map(|file_type| file_type.is_dir()) - .unwrap_or(false) - })) + .map(|mut entries| { + entries.any(|entry| { + entry + .ok() + .and_then(|entry| entry.file_type().ok()) + .map(|file_type| file_type.is_dir()) + .unwrap_or(false) + }) + }) .unwrap_or(false) } @@ -446,7 +453,10 @@ fn list_child_directories(path: &Path) -> Result, String> { } let child_path = entry.path(); - let is_dir = entry.file_type().map(|file_type| file_type.is_dir()).unwrap_or(false); + let is_dir = entry + .file_type() + .map(|file_type| file_type.is_dir()) + .unwrap_or(false); if !is_dir { continue; } diff --git a/src-tauri/src/db.rs b/src-tauri/src/db.rs index cdcb7bf..8f9223f 100644 --- a/src-tauri/src/db.rs +++ b/src-tauri/src/db.rs @@ -1727,6 +1727,7 @@ pub fn get_images( Ok(rows.collect::>>()?) } +#[allow(clippy::too_many_arguments)] pub fn count_images( conn: &Connection, folder_id: Option,