From 8bd1a8507080ee4929fb16f7889cb75f94497d74 Mon Sep 17 00:00:00 2001 From: Cameron Cordes Date: Thu, 7 May 2026 17:53:31 -0400 Subject: [PATCH] insight-chat: cargo fmt sweep on the get_faces_in_photo additions Single-line dao lock + reordered faces import. No logic changes. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/ai/insight_generator.rs | 18 ++++++------------ src/state.rs | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/ai/insight_generator.rs b/src/ai/insight_generator.rs index 1267628..3e0d7fb 100644 --- a/src/ai/insight_generator.rs +++ b/src/ai/insight_generator.rs @@ -181,10 +181,7 @@ impl InsightGenerator { dao.has_any_summaries(&cx).unwrap_or(false) }; let faces_present = { - let mut dao = self - .face_dao - .lock() - .expect("Unable to lock FaceDao"); + let mut dao = self.face_dao.lock().expect("Unable to lock FaceDao"); dao.has_any_faces(&cx).unwrap_or(false) }; ToolGateOpts { @@ -2217,16 +2214,13 @@ Return ONLY the summary, nothing else."#, let mut out = format!("Found {} face(s) in this photo:\n", faces.len()); for f in &bound { // Invariant: `bound` is filtered on `person_name.is_some()` above. - let name = f.person_name.as_deref().expect("bound face must have a name"); + let name = f + .person_name + .as_deref() + .expect("bound face must have a name"); out.push_str(&format!( "- {} (confidence {:.2}, bbox x={:.2} y={:.2} w={:.2} h={:.2}, source: {})\n", - name, - f.confidence, - f.bbox_x, - f.bbox_y, - f.bbox_w, - f.bbox_h, - f.source, + name, f.confidence, f.bbox_x, f.bbox_y, f.bbox_w, f.bbox_h, f.source, )); } for f in &unbound { diff --git a/src/state.rs b/src/state.rs index adbf527..e0234a2 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,6 +1,5 @@ use crate::ai::apollo_client::ApolloClient; use crate::ai::face_client::FaceClient; -use crate::faces; use crate::ai::insight_chat::{ChatLockMap, InsightChatService}; use crate::ai::openrouter::OpenRouterClient; use crate::ai::{InsightGenerator, OllamaClient, SmsApiClient}; @@ -11,6 +10,7 @@ use crate::database::{ connect, }; use crate::database::{PreviewDao, SqlitePreviewDao}; +use crate::faces; use crate::libraries::{self, Library, LibraryHealthMap}; use crate::tags::{SqliteTagDao, TagDao}; use crate::video::actors::{