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: fix cargo fmt drift blocking CI

Louis Beaumont6caa5e4dd725
diff --git a/crates/screenpipe-config/src/recording.rs b/crates/screenpipe-config/src/recording.rs
index d490102be..4c8eadfc6 100644
--- a/crates/screenpipe-config/src/recording.rs
+++ b/crates/screenpipe-config/src/recording.rs
@@ -372,7 +372,10 @@ pub struct RecordingSettings {
/// what's stored (see screenpipe-redact `parse_allow_list`). The
/// Settings UI surfaces a curated subset (Names, Emails, Phones,
/// Addresses, Sensitive) as opt-in checkboxes.
- #[serde(rename = "piiRedactionLabels", default = "default_pii_redaction_labels")]
+ #[serde(
+ rename = "piiRedactionLabels",
+ default = "default_pii_redaction_labels"
+ )]
pub pii_redaction_labels: Vec<String>,
// ── Cloud / Auth ───────────────────────────────────────────────────
diff --git a/crates/screenpipe-engine/benches/alloc_counter.rs b/crates/screenpipe-engine/benches/alloc_counter.rs
index ece3399cb..74d0b6e75 100644
--- a/crates/screenpipe-engine/benches/alloc_counter.rs
+++ b/crates/screenpipe-engine/benches/alloc_counter.rs
@@ -14,7 +14,7 @@
//! cargo bench -p screenpipe-engine --bench alloc_counter
use chrono::Utc;
-use criterion::{Criterion, black_box, criterion_group, criterion_main};
+use criterion::{black_box, criterion_group, criterion_main, Criterion};
use screenpipe_engine::hot_frame_cache::{HotAudio, HotFrame};
use std::alloc::{GlobalAlloc, Layout, System};
use std::sync::atomic::{AtomicUsize, Ordering};
@@ -77,11 +77,14 @@ fn make_frame(id: i64) -> HotFrame {
device_name: "monitor_0".into(),
app_name: "Google Chrome".into(),
window_name: "screenpipe — Memory Optimization - Google Chrome".into(),
- ocr_text_preview: "The quick brown fox jumps over the lazy dog. ".repeat(4).into(),
+ ocr_text_preview: "The quick brown fox jumps over the lazy dog. "
+ .repeat(4)
+ .into(),
snapshot_path: format!(
"/Users/user/Library/Application Support/screenpipe/data/monitor_0_{}.jpg",
id
- ).into(),
+ )
+ .into(),
browser_url: Some("https://github.com/mediar-ai/screenpipe".into()),
capture_trigger: "app_switch".into(),
offset_index: id * 30,
diff --git a/crates/screenpipe-engine/benches/hot_frame_cache.rs b/crates/screenpipe-engine/benches/hot_frame_cache.rs
index c909d7e8d..033ecbb0a 100644
--- a/crates/screenpipe-engine/benches/hot_frame_cache.rs
+++ b/crates/screenpipe-engine/benches/hot_frame_cache.rs
@@ -16,7 +16,7 @@
//! cargo bench -p screenpipe-engine --bench hot_frame_cache
use chrono::{Duration, Utc};
-use criterion::{BenchmarkId, Criterion, black_box, criterion_group, criterion_main};
+use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
use screenpipe_engine::hot_frame_cache::{HotAudio, HotFrame, HotFrameCache};
// ---------------------------------------------------------------------------
@@ -30,8 +30,14 @@ fn make_frame(id: i64) -> HotFrame {
device_name: "monitor_0".into(),
app_name: "Google Chrome".into(),
window_name: "screenpipe — Memory Optimization - Google Chrome".into(),
- ocr_text_preview: "The quick brown fox jumps over the lazy dog. ".repeat(4).into(),
- snapshot_path: format!("/Users/user/Library/Application Support/screenpipe/data/monitor_0_{}.jpg", id).into(),
+ ocr_text_preview: "The quick brown fox jumps over the lazy dog. "
+ .repeat(4)
+ .into(),
+ snapshot_path: format!(
+ "/Users/user/Library/Application Support/screenpipe/data/monitor_0_{}.jpg",
+ id
+ )
+ .into(),
browser_url: Some("https://github.com/mediar-ai/screenpipe".into()),
capture_trigger: "app_switch".into(),
offset_index: id * 30,
@@ -72,9 +78,7 @@ fn rt() -> tokio::runtime::Runtime {
fn bench_hotframe_clone(c: &mut Criterion) {
let frame = make_frame(1);
- c.bench_function("HotFrame::clone", |b| {
- b.iter(|| black_box(frame.clone()))
- });
+ c.bench_function("HotFrame::clone", |b| b.iter(|| black_box(frame.clone())));
}
// ---------------------------------------------------------------------------
@@ -119,9 +123,7 @@ fn bench_get_frames_in_range(c: &mut Criterion) {
let end = base + Duration::hours(8);
group.bench_with_input(BenchmarkId::from_parameter(n), &n, |b, _| {
- b.iter(|| {
- rt.block_on(cache.get_frames_in_range(black_box(start), black_box(end)))
- });
+ b.iter(|| rt.block_on(cache.get_frames_in_range(black_box(start), black_box(end))));
});
}
group.finish();
@@ -165,9 +167,7 @@ fn bench_find_audio_near(c: &mut Criterion) {
});
c.bench_function("HotFrameCache::find_audio_near", |b| {
- b.iter(|| {
- rt.block_on(cache.find_audio_near(black_box(base_ts)))
- });
+ b.iter(|| rt.block_on(cache.find_audio_near(black_box(base_ts))));
});
}
diff --git a/crates/screenpipe-engine/src/bin/screenpipe-engine.rs b/crates/screenpipe-engine/src/bin/screenpipe-engine.rs
index a9f8e5262..af081e684 100644
--- a/crates/screenpipe-engine/src/bin/screenpipe-engine.rs
+++ b/crates/screenpipe-engine/src/bin/screenpipe-engine.rs
@@ -1804,12 +1804,11 @@ async fn main() -> anyhow::Result<()> {
"text-PII AI step: tinfoil enclave (local adapters \
unavailable: opf-rs={e})"
);
- let ai: Arc<dyn Redactor> = Arc::new(TinfoilRedactor::new(
- TinfoilConfig {
+ let ai: Arc<dyn Redactor> =
+ Arc::new(TinfoilRedactor::new(TinfoilConfig {
labels: labels.clone(),
..Default::default()
- },
- ));
+ }));
Pipeline::regex_then_ai(
ai,
PipelineConfig {
diff --git a/crates/screenpipe-engine/src/hd_recorder.rs b/crates/screenpipe-engine/src/hd_recorder.rs
index f4b9a6e35..e1796fe78 100644
--- a/crates/screenpipe-engine/src/hd_recorder.rs
+++ b/crates/screenpipe-engine/src/hd_recorder.rs
@@ -253,13 +253,12 @@ mod macos {
break;
}
// Timeout so we re-check the end conditions even if frames stall.
- let frame = match tokio::time::timeout(Duration::from_millis(500), hd.frames.recv())
- .await
- {
- Ok(Some(f)) => f,
- Ok(None) => break, // stream closed
- Err(_) => continue,
- };
+ let frame =
+ match tokio::time::timeout(Duration::from_millis(500), hd.frames.recv()).await {
+ Ok(Some(f)) => f,
+ Ok(None) => break, // stream closed
+ Err(_) => continue,
+ };
let jpeg = encode_jpeg(frame)?;
if let Err(e) = stdin.write_all(&jpeg).await {
@@ -349,7 +348,10 @@ mod macos {
let rgb = image::DynamicImage::ImageRgba8(frame).to_rgb8();
let mut buf = Vec::new();
image::DynamicImage::ImageRgb8(rgb)
- .write_to(&mut std::io::Cursor::new(&mut buf), image::ImageFormat::Jpeg)
+ .write_to(
+ &mut std::io::Cursor::new(&mut buf),
+ image::ImageFormat::Jpeg,
+ )
.context("jpeg encode")?;
Ok(buf)
}
diff --git a/crates/screenpipe-engine/src/hot_frame_cache.rs b/crates/screenpipe-engine/src/hot_frame_cache.rs
index 734dff170..812297387 100644
--- a/crates/screenpipe-engine/src/hot_frame_cache.rs
+++ b/crates/screenpipe-engine/src/hot_frame_cache.rs
@@ -235,7 +235,12 @@ impl HotFrameCache {
device_name: Arc::from(ocr_entry.device_name.as_str()),
app_name: Arc::from(ocr_entry.app_name.as_str()),
window_name: Arc::from(ocr_entry.window_name.as_str()),
- ocr_text_preview: ocr_entry.text.chars().take(200).collect::<String>().into(),
+ ocr_text_preview: ocr_entry
+ .text
+ .chars()
+ .take(200)
+ .collect::<String>()
+ .into(),
snapshot_path: Arc::from(ocr_entry.video_file_path.as_str()),
browser_url: ocr_entry.browser_url.as_deref().map(Arc::from),
capture_trigger: Arc::from(""),
diff --git a/crates/screenpipe-engine/src/vision_manager/manager.rs b/crates/screenpipe-engine/src/vision_manager/manager.rs
index f5527c648..f2f897a92 100644
--- a/crates/screenpipe-engine/src/vision_manager/manager.rs
+++ b/crates/screenpipe-engine/src/vision_manager/manager.rs
@@ -511,16 +511,18 @@ impl VisionManager {
ignored_windows: self.config.ignored_windows.clone(),
included_windows: self.config.included_windows.clone(),
};
- let hd_handle = self.vision_handle.spawn(crate::hd_recorder::hd_recorder_loop(
- self.db.clone(),
- monitor.clone(),
- monitor_id,
- device_name.clone(),
- std::path::PathBuf::from(format!("{}/data", output_path)),
- hd_config,
- Arc::new(AtomicBool::new(false)),
- high_fps_controller.clone(),
- ));
+ let hd_handle = self
+ .vision_handle
+ .spawn(crate::hd_recorder::hd_recorder_loop(
+ self.db.clone(),
+ monitor.clone(),
+ monitor_id,
+ device_name.clone(),
+ std::path::PathBuf::from(format!("{}/data", output_path)),
+ hd_config,
+ Arc::new(AtomicBool::new(false)),
+ high_fps_controller.clone(),
+ ));
self.hd_recording_tasks.insert(monitor_id, hd_handle);
}
diff --git a/crates/screenpipe-redact/src/span.rs b/crates/screenpipe-redact/src/span.rs
index d9c40910c..0787e523f 100644
--- a/crates/screenpipe-redact/src/span.rs
+++ b/crates/screenpipe-redact/src/span.rs
@@ -183,7 +183,10 @@ mod tests {
assert_eq!(SpanLabel::from_wire("person"), Some(SpanLabel::Person));
assert_eq!(SpanLabel::from_wire(" Email "), Some(SpanLabel::Email));
assert_eq!(SpanLabel::from_wire("SECRET"), Some(SpanLabel::Secret));
- assert_eq!(SpanLabel::from_wire("sensitive"), Some(SpanLabel::Sensitive));
+ assert_eq!(
+ SpanLabel::from_wire("sensitive"),
+ Some(SpanLabel::Sensitive)
+ );
assert_eq!(SpanLabel::from_wire("nonsense"), None);
assert_eq!(SpanLabel::from_wire(""), None);
}
diff --git a/crates/screenpipe-screen/src/lib.rs b/crates/screenpipe-screen/src/lib.rs
index 7457afefe..bd1a61d02 100644
--- a/crates/screenpipe-screen/src/lib.rs
+++ b/crates/screenpipe-screen/src/lib.rs
@@ -12,9 +12,9 @@ pub mod microsoft;
pub mod monitor;
#[cfg(target_os = "windows")]
pub mod wgc_capture;
-pub use monitor::MonitorListError;
#[cfg(target_os = "macos")]
pub use monitor::HdCapture;
+pub use monitor::MonitorListError;
pub mod metrics;
pub mod ocr_cache;
pub mod tesseract;