From 0af7c8f98bd6d12e157404337ebfb149a63c53a4 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 27 Nov 2024 15:43:27 -0500 Subject: [PATCH] Fix missing return and update test signatures --- src/files.rs | 9 +++++++-- src/tags.rs | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/files.rs b/src/files.rs index c830745..9704118 100644 --- a/src/files.rs +++ b/src/files.rs @@ -59,7 +59,7 @@ pub async fn list_photos( .filter_map(|t| t.parse().ok()) .collect::>(); - match filter_mode { + return match filter_mode { FilterMode::Any => dao.get_files_with_any_tag_ids(tag_ids.clone(), exclude_tag_ids), FilterMode::All => dao.get_files_with_all_tag_ids(tag_ids.clone(), exclude_tag_ids), } @@ -67,8 +67,13 @@ pub async fn list_photos( "Failed to get files with tag_ids: {:?} with filter_mode: {:?}", tag_ids, filter_mode )) + .inspect(|files| debug!("Found {:?} files", files.len())) .map(|tagged_files: Vec| { - trace!("Found {:?} tagged files: {:?}", tagged_files.len(), tagged_files); + trace!( + "Found {:?} tagged files: {:?}", + tagged_files.len(), + tagged_files + ); HttpResponse::Ok().json(PhotosResponse { photos: tagged_files, diff --git a/src/tags.rs b/src/tags.rs index 2474670..d7abaca 100644 --- a/src/tags.rs +++ b/src/tags.rs @@ -506,12 +506,16 @@ mod tests { fn get_files_with_all_tag_ids( &mut self, tag_ids: Vec, - exclude_tag_ids: Vec, + _exclude_tag_ids: Vec, ) -> anyhow::Result> { todo!() } - fn get_files_with_any_tag_ids(&mut self, tag_ids: Vec) -> anyhow::Result> { + fn get_files_with_any_tag_ids( + &mut self, + _tag_ids: Vec, + _exclude_tag_ids: Vec, + ) -> anyhow::Result> { todo!() } }