Run clippy fix

This commit is contained in:
Cameron
2026-01-14 13:17:58 -05:00
parent e9729e9956
commit e2d6cd7258
19 changed files with 123 additions and 158 deletions

View File

@@ -36,7 +36,7 @@ struct EmbeddingRow {
}
fn deserialize_embedding(bytes: &[u8]) -> Result<Vec<f32>> {
if bytes.len() % 4 != 0 {
if !bytes.len().is_multiple_of(4) {
return Err(anyhow::anyhow!("Invalid embedding byte length"));
}

View File

@@ -74,18 +74,16 @@ async fn main() -> Result<()> {
let mut dao_instance = SqliteCalendarEventDao::new();
// Check if event exists
if args.skip_existing {
if let Ok(exists) = dao_instance.event_exists(
if args.skip_existing
&& let Ok(exists) = dao_instance.event_exists(
&context,
event.event_uid.as_deref().unwrap_or(""),
event.start_time,
) {
if exists {
)
&& exists {
*skipped_count.lock().unwrap() += 1;
continue;
}
}
}
// Generate embedding if requested (blocking call)
let embedding = if let Some(ref ollama_client) = ollama {

View File

@@ -58,19 +58,17 @@ async fn main() -> Result<()> {
for location in chunk {
// Skip existing check if requested (makes import much slower)
if args.skip_existing {
if let Ok(exists) = dao_instance.location_exists(
if args.skip_existing
&& let Ok(exists) = dao_instance.location_exists(
&context,
location.timestamp,
location.latitude,
location.longitude,
) {
if exists {
)
&& exists {
skipped_count += 1;
continue;
}
}
}
batch_inserts.push(InsertLocationRecord {
timestamp: location.timestamp,

View File

@@ -92,16 +92,13 @@ async fn main() -> Result<()> {
for (search, embedding_opt) in chunk.iter().zip(embeddings_result.iter()) {
// Check if search exists (optional for speed)
if args.skip_existing {
if let Ok(exists) =
if args.skip_existing
&& let Ok(exists) =
dao_instance.search_exists(&context, search.timestamp, &search.query)
{
if exists {
&& exists {
skipped_count += 1;
continue;
}
}
}
// Only insert if we have an embedding
if let Some(embedding) = embedding_opt {

View File

@@ -3,7 +3,6 @@ use std::sync::{Arc, Mutex};
use chrono::Utc;
use clap::Parser;
use opentelemetry;
use rayon::prelude::*;
use walkdir::WalkDir;