insight-chat: code-review polish on get_faces_in_photo

- Drop redundant `use anyhow::Context` inside has_any_faces (already
  imported at the module level).
- Drop dead `.unwrap_or("?")` on bound faces — the vec is filtered to
  is_some() so the fallback can never fire.
- Reorder the face_dao constructor param + initializer to match the
  struct declaration (between tag_dao and knowledge_dao). Update both
  state.rs call sites and populate_knowledge.rs to match.
- Hold face_dao lock once across the library-resolver loop instead of
  reacquiring per iteration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cameron Cordes
2026-05-07 17:48:22 -04:00
parent b64a5bec28
commit 6f0c15d0c5
4 changed files with 17 additions and 15 deletions

View File

@@ -234,8 +234,8 @@ impl Default for AppState {
location_dao.clone(),
search_dao.clone(),
tag_dao.clone(),
knowledge_dao,
face_dao.clone(),
knowledge_dao,
libraries_vec.clone(),
);
@@ -376,8 +376,8 @@ impl AppState {
location_dao.clone(),
search_dao.clone(),
tag_dao.clone(),
knowledge_dao,
face_dao.clone(),
knowledge_dao,
vec![test_lib],
);