Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

style(vision): fix cargo fmt formatting issues

Louis Beaumontd82c1f3ce84f
diff --git a/screenpipe-vision/src/core.rs b/screenpipe-vision/src/core.rs
index bdc568be2..869b4d9cc 100644
--- a/screenpipe-vision/src/core.rs
+++ b/screenpipe-vision/src/core.rs
@@ -28,8 +28,8 @@ use std::{
collections::HashMap,
time::{Duration, Instant, UNIX_EPOCH},
};
-use tokio::sync::Mutex;
use tokio::sync::mpsc::Sender;
+use tokio::sync::Mutex;
use tracing::{debug, error, warn};
fn serialize_image<S>(image: &Option<DynamicImage>, serializer: S) -> Result<S::Ok, S::Error>
@@ -361,8 +361,10 @@ pub async fn process_ocr_task(
for captured_window in window_images {
// Calculate hash for this window's image
- let window_image_hash = WindowOcrCache::calculate_image_hash(captured_window.image.as_bytes());
- let window_id = WindowOcrCache::make_window_id(&captured_window.app_name, &captured_window.window_name);
+ let window_image_hash =
+ WindowOcrCache::calculate_image_hash(captured_window.image.as_bytes());
+ let window_id =
+ WindowOcrCache::make_window_id(&captured_window.app_name, &captured_window.window_name);
let cache_key = WindowCacheKey {
window_id: window_id.clone(),
image_hash: window_image_hash,
@@ -426,12 +428,7 @@ pub async fn process_ocr_task(
{
let mut cache = ocr_cache.lock().await;
let json_str = serde_json::to_string(&result.text_json).unwrap_or_default();
- cache.insert(
- cache_key,
- result.text.clone(),
- json_str,
- result.confidence,
- );
+ cache.insert(cache_key, result.text.clone(), json_str, result.confidence);
}
result
diff --git a/screenpipe-vision/src/ocr_cache.rs b/screenpipe-vision/src/ocr_cache.rs
index 981dbf3be..dc3872536 100644
--- a/screenpipe-vision/src/ocr_cache.rs
+++ b/screenpipe-vision/src/ocr_cache.rs
@@ -76,7 +76,13 @@ impl WindowOcrCache {
}
/// Store an OCR result in the cache
- pub fn insert(&mut self, key: WindowCacheKey, text: String, text_json: String, confidence: f64) {
+ pub fn insert(
+ &mut self,
+ key: WindowCacheKey,
+ text: String,
+ text_json: String,
+ confidence: f64,
+ ) {
// Evict oldest entries if at capacity
if self.cache.len() >= self.max_entries {
self.evict_oldest();
@@ -307,7 +313,12 @@ mod tests {
image_hash: *hash,
};
let result = cache.get(&key);
- assert!(result.is_some(), "Should find cached result for {}::{}", app, window);
+ assert!(
+ result.is_some(),
+ "Should find cached result for {}::{}",
+ app,
+ window
+ );
assert_eq!(result.unwrap().text, *text);
}