fix(db): suppress too_many_arguments clippy lint on count_images
github/actions/ci GitHub Actions CI finished: failure

This commit is contained in:
2026-06-21 19:38:06 +01:00
parent ebed194f17
commit 1e008244ae
2 changed files with 20 additions and 9 deletions
+14 -4
View File
@@ -330,7 +330,12 @@ pub async fn add_folders(
Ok(paths Ok(paths
.into_iter() .into_iter()
.map(|path| { .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::Added(folder)) => FolderAddResult::Added(folder),
Ok(AddOutcome::Skipped(folder)) => FolderAddResult::Skipped(folder.path), Ok(AddOutcome::Skipped(folder)) => FolderAddResult::Skipped(folder.path),
Err(error) => FolderAddResult::Error(error), Err(error) => FolderAddResult::Error(error),
@@ -365,13 +370,15 @@ fn path_to_string(path: &Path) -> String {
fn directory_has_children(path: &Path) -> bool { fn directory_has_children(path: &Path) -> bool {
std::fs::read_dir(path) std::fs::read_dir(path)
.map(|mut entries| entries.any(|entry| { .map(|mut entries| {
entries.any(|entry| {
entry entry
.ok() .ok()
.and_then(|entry| entry.file_type().ok()) .and_then(|entry| entry.file_type().ok())
.map(|file_type| file_type.is_dir()) .map(|file_type| file_type.is_dir())
.unwrap_or(false) .unwrap_or(false)
})) })
})
.unwrap_or(false) .unwrap_or(false)
} }
@@ -446,7 +453,10 @@ fn list_child_directories(path: &Path) -> Result<Vec<DirEntry>, String> {
} }
let child_path = entry.path(); 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 { if !is_dir {
continue; continue;
} }
+1
View File
@@ -1727,6 +1727,7 @@ pub fn get_images(
Ok(rows.collect::<rusqlite::Result<Vec<_>>>()?) Ok(rows.collect::<rusqlite::Result<Vec<_>>>()?)
} }
#[allow(clippy::too_many_arguments)]
pub fn count_images( pub fn count_images(
conn: &Connection, conn: &Connection,
folder_id: Option<i64>, folder_id: Option<i64>,