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: rustfmt event_driven_capture + metrics (fix Clippy & Format drift)

Louis Beaumont56277e45677d
diff --git a/crates/screenpipe-engine/src/event_driven_capture.rs b/crates/screenpipe-engine/src/event_driven_capture.rs
index c915ff253..efd2f0259 100644
--- a/crates/screenpipe-engine/src/event_driven_capture.rs
+++ b/crates/screenpipe-engine/src/event_driven_capture.rs
@@ -2390,11 +2390,7 @@ const CORRUPT_GRID: usize = 15;
/// further.
fn is_garbage_green(px: [u8; 3]) -> bool {
let [r, g, b] = px;
- g >= 100
- && r <= 70
- && b <= 70
- && g >= r.saturating_add(60)
- && g >= b.saturating_add(60)
+ g >= 100 && r <= 70 && b <= 70 && g >= r.saturating_add(60) && g >= b.saturating_add(60)
}
/// Result of one cheap pass over a captured frame's sample grid.
@@ -3299,7 +3295,11 @@ mod tests {
// is anchored to the bottom, so a top-only green region never trips it.
let mut buf = image::RgbImage::new(1920, 1080);
for y in 0..1080 {
- let color = if y < 324 { [0, 150, 0] } else { [120, 130, 140] };
+ let color = if y < 324 {
+ [0, 150, 0]
+ } else {
+ [120, 130, 140]
+ };
for x in 0..1920 {
buf.put_pixel(x, y, image::Rgb(color));
}
@@ -3372,7 +3372,11 @@ mod tests {
let mut buf = image::RgbaImage::new(1280, 800);
for y in 0..800 {
for x in 0..1280 {
- let c = if y >= 480 { [0, 150, 0, 255] } else { [120, 130, 140, 255] };
+ let c = if y >= 480 {
+ [0, 150, 0, 255]
+ } else {
+ [120, 130, 140, 255]
+ };
buf.put_pixel(x, y, image::Rgba(c));
}
}
diff --git a/crates/screenpipe-screen/src/metrics.rs b/crates/screenpipe-screen/src/metrics.rs
index 102e29278..8c1555832 100644
--- a/crates/screenpipe-screen/src/metrics.rs
+++ b/crates/screenpipe-screen/src/metrics.rs
@@ -588,8 +588,8 @@ mod tests {
assert_eq!(s.frames_corrupt_black, 2);
assert_eq!(s.frames_corrupt_green, 1);
assert_eq!(s.dedup_skips, 2); // corrupt skips did NOT inflate dedup
- // residual = attempts - written - dedup - corrupt - dropped
- // = 10 - 5 - 2 - 3 - 0 = 0
+ // residual = attempts - written - dedup - corrupt - dropped
+ // = 10 - 5 - 2 - 3 - 0 = 0
assert_eq!(s.silent_loss, 0);
assert_eq!(s.silent_loss_rate, 0.0);
}