chore: apply cargo fmt + clippy cleanup across crate

Silence forward-looking dead_code on unused DAO modules, annotate
individual placeholder items, rewrite tautological assert!(true/false)
in token tests as panic! arms, and pick up fmt drift.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cameron
2026-04-18 16:50:15 -04:00
committed by cameron
parent a0f3bfab5f
commit c2ee3996be
22 changed files with 106 additions and 67 deletions

View File

@@ -1,3 +1,5 @@
#![allow(dead_code)]
use diesel::prelude::*;
use diesel::sqlite::SqliteConnection;
use serde::Serialize;

View File

@@ -1,3 +1,5 @@
#![allow(dead_code)]
use chrono::NaiveDate;
use diesel::prelude::*;
use diesel::sqlite::SqliteConnection;

View File

@@ -31,6 +31,7 @@ pub trait InsightDao: Sync + Send {
paths: &[String],
) -> Result<Option<PhotoInsight>, DbError>;
#[allow(dead_code)]
fn get_insight_history(
&mut self,
context: &opentelemetry::Context,
@@ -79,6 +80,7 @@ impl SqliteInsightDao {
}
#[cfg(test)]
#[allow(dead_code)]
pub fn from_connection(conn: Arc<Mutex<SqliteConnection>>) -> Self {
SqliteInsightDao { connection: conn }
}

View File

@@ -1,3 +1,5 @@
#![allow(dead_code)]
use diesel::prelude::*;
use diesel::sqlite::SqliteConnection;
use std::ops::DerefMut;
@@ -230,7 +232,7 @@ impl SqliteKnowledgeDao {
}
fn deserialize_embedding(bytes: &[u8]) -> Result<Vec<f32>, DbError> {
if bytes.len() % 4 != 0 {
if !bytes.len().is_multiple_of(4) {
return Err(DbError::new(DbErrorKind::QueryError));
}
Ok(bytes
@@ -535,7 +537,6 @@ impl KnowledgeDao for SqliteKnowledgeDao {
conn.transaction::<(i64, i64), diesel::result::Error, _>(|conn| {
use schema::entity_facts::dsl as ef;
use schema::entity_photo_links::dsl as epl;
// 1. Re-point facts where source is subject
let facts_updated =

View File

@@ -1,3 +1,5 @@
#![allow(dead_code)]
use diesel::prelude::*;
use diesel::sqlite::SqliteConnection;
use serde::Serialize;

View File

@@ -155,7 +155,9 @@ pub trait FavoriteDao: Sync + Send {
fn add_favorite(&mut self, user_id: i32, favorite_path: &str) -> Result<usize, DbError>;
fn remove_favorite(&mut self, user_id: i32, favorite_path: String);
fn get_favorites(&mut self, user_id: i32) -> Result<Vec<Favorite>, DbError>;
#[allow(dead_code)]
fn update_path(&mut self, old_path: &str, new_path: &str) -> Result<(), DbError>;
#[allow(dead_code)]
fn get_all_paths(&mut self) -> Result<Vec<String>, DbError>;
}
@@ -239,6 +241,7 @@ impl FavoriteDao for SqliteFavoriteDao {
}
}
#[allow(dead_code)]
pub trait ExifDao: Sync + Send {
fn store_exif(
&mut self,
@@ -306,6 +309,7 @@ pub trait ExifDao: Sync + Send {
/// Get all photos with GPS coordinates
/// Returns Vec<(file_path, latitude, longitude, date_taken)>
#[allow(clippy::type_complexity)]
fn get_all_with_gps(
&mut self,
context: &opentelemetry::Context,
@@ -680,7 +684,6 @@ impl ExifDao for SqliteExifDao {
.map_err(|_| DbError::new(DbErrorKind::QueryError))
}
fn get_all_with_gps(
&mut self,
context: &opentelemetry::Context,

View File

@@ -1,3 +1,5 @@
#![allow(dead_code)]
use diesel::prelude::*;
use diesel::sqlite::SqliteConnection;
use std::ops::DerefMut;

View File

@@ -1,3 +1,5 @@
#![allow(dead_code)]
use diesel::prelude::*;
use diesel::sqlite::SqliteConnection;
use serde::Serialize;