fix(db): suppress too_many_arguments clippy lint on count_images
github/actions/ci GitHub Actions CI finished: failure
github/actions/ci GitHub Actions CI finished: failure
This commit is contained in:
@@ -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| {
|
||||||
entry
|
entries.any(|entry| {
|
||||||
.ok()
|
entry
|
||||||
.and_then(|entry| entry.file_type().ok())
|
.ok()
|
||||||
.map(|file_type| file_type.is_dir())
|
.and_then(|entry| entry.file_type().ok())
|
||||||
.unwrap_or(false)
|
.map(|file_type| file_type.is_dir())
|
||||||
}))
|
.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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>,
|
||||||
|
|||||||
Reference in New Issue
Block a user