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

fix(rust): trim dead code suppressions

Louis Beaumont831d5db4d09c
diff --git a/crates/screenpipe-connect/src/mcp_servers.rs b/crates/screenpipe-connect/src/mcp_servers.rs
index 580ef5ce8..031b61904 100644
--- a/crates/screenpipe-connect/src/mcp_servers.rs
+++ b/crates/screenpipe-connect/src/mcp_servers.rs
@@ -1311,8 +1311,7 @@ struct StdioSession {
/// Stderr lines buffered so we can include them in error messages.
stderr_buf: Arc<Mutex<String>>,
/// Kept alive via kill_on_drop — dropped (and process killed) when session is dropped.
- #[allow(dead_code)]
- child: tokio::process::Child,
+ _child: tokio::process::Child,
/// PID of the spawned process. On Windows this is cmd.exe; on Unix it's the
/// direct child. Stored so Drop can kill the whole process tree / group.
pid: u32,
@@ -1388,7 +1387,7 @@ impl StdioSession {
reader: BufReader::new(stdout).lines(),
next_id: 0,
stderr_buf,
- child,
+ _child: child,
pid,
})
}
diff --git a/crates/screenpipe-core/src/ffmpeg.rs b/crates/screenpipe-core/src/ffmpeg.rs
index 3cc4db30e..23ed32188 100644
--- a/crates/screenpipe-core/src/ffmpeg.rs
+++ b/crates/screenpipe-core/src/ffmpeg.rs
@@ -23,23 +23,33 @@ pub fn find_ffmpeg_path() -> Option<PathBuf> {
/// Create a `std::process::Command` for ffmpeg with `CREATE_NO_WINDOW` on Windows.
pub fn ffmpeg_cmd(path: impl AsRef<std::ffi::OsStr>) -> std::process::Command {
- #[allow(unused_mut)]
- let mut cmd = std::process::Command::new(path);
+ #[cfg(not(windows))]
+ {
+ std::process::Command::new(path)
+ }
+
#[cfg(windows)]
{
+ let mut cmd = std::process::Command::new(path);
use std::os::windows::process::CommandExt;
cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
+ cmd
}
- cmd
}
/// Create a `tokio::process::Command` for ffmpeg with `CREATE_NO_WINDOW` on Windows.
pub fn ffmpeg_cmd_async(path: impl AsRef<std::ffi::OsStr>) -> tokio::process::Command {
- #[allow(unused_mut)]
- let mut cmd = tokio::process::Command::new(path);
+ #[cfg(not(windows))]
+ {
+ tokio::process::Command::new(path)
+ }
+
#[cfg(windows)]
- cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
- cmd
+ {
+ let mut cmd = tokio::process::Command::new(path);
+ cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
+ cmd
+ }
}
/// True when a usable ffprobe exists next to the given ffmpeg binary, OR
diff --git a/crates/screenpipe-core/src/pipes/mod.rs b/crates/screenpipe-core/src/pipes/mod.rs
index 8ad2578b2..bb65a176e 100644
--- a/crates/screenpipe-core/src/pipes/mod.rs
+++ b/crates/screenpipe-core/src/pipes/mod.rs
@@ -3999,8 +3999,7 @@ impl PipeManager {
pub fn install_builtin_pipes(&self) -> Result<()> {
// Manual pipes are bundled as templates. Scheduled pipes (idea-tracker,
// obsidian-sync) are available from the pipe store instead.
- #[allow(unused_mut)]
- let mut builtins = vec![
+ let builtins = vec![
(
"day-recap",
include_str!("../../assets/pipes/day-recap/pipe.md"),
diff --git a/crates/screenpipe-core/src/sync/client.rs b/crates/screenpipe-core/src/sync/client.rs
index 426d0d09a..2a2c54ece 100644
--- a/crates/screenpipe-core/src/sync/client.rs
+++ b/crates/screenpipe-core/src/sync/client.rs
@@ -510,7 +510,6 @@ impl SyncClient {
if !response.status().is_success() {
let error_body: ApiError = response.json().await.unwrap_or(ApiError {
- success: false,
error: Some("unknown error".to_string()),
code: None,
});
@@ -544,7 +543,6 @@ impl SyncClient {
if !response.status().is_success() {
let error_body: ApiError = response.json().await.unwrap_or(ApiError {
- success: false,
error: Some("unknown error".to_string()),
code: None,
});
@@ -658,7 +656,6 @@ impl SyncClient {
if status == StatusCode::FORBIDDEN {
// Could be quota or subscription issue
let error_body: ApiError = response.json().await.unwrap_or(ApiError {
- success: false,
error: Some("forbidden".to_string()),
code: None,
});
@@ -1009,8 +1006,6 @@ pub struct SyncDevice {
#[derive(Debug, Deserialize)]
struct ApiError {
- #[allow(dead_code)]
- success: bool,
#[serde(default)]
error: Option<String>,
#[serde(default)]
diff --git a/crates/screenpipe-redact/src/adapters/onnx.rs b/crates/screenpipe-redact/src/adapters/onnx.rs
index 909ec6ccb..92bac4b8b 100644
--- a/crates/screenpipe-redact/src/adapters/onnx.rs
+++ b/crates/screenpipe-redact/src/adapters/onnx.rs
@@ -100,10 +100,6 @@ impl OnnxConfig {
self.model_dir.join("tokenizer.json")
}
- fn config_path(&self) -> PathBuf {
- self.model_dir.join("config.json")
- }
-
/// HuggingFace repo where the canonical v45 phase 3 ONNX artifacts
/// live. Pinned to `main` so a model bump goes through a deliberate
/// code change (URL + expected SHA-256 + [`ONNX_REDACTOR_VERSION`]
diff --git a/crates/screenpipe-redact/src/adapters/tinfoil.rs b/crates/screenpipe-redact/src/adapters/tinfoil.rs
index 4a5e6e2f4..33d766bd1 100644
--- a/crates/screenpipe-redact/src/adapters/tinfoil.rs
+++ b/crates/screenpipe-redact/src/adapters/tinfoil.rs
@@ -148,8 +148,7 @@ struct FilterResponse {
/// [`reqwest::Client`] for actual request dispatch.
struct CachedClient {
/// Keeps the SDK verifier alive for `http`'s lifetime.
- #[allow(dead_code)]
- inner: tinfoil::Client,
+ _inner: tinfoil::Client,
http: reqwest::Client,
created_at: Instant,
}
@@ -286,7 +285,7 @@ impl TinfoilRedactor {
.clone();
let http_clone = http.clone();
*g = Some(CachedClient {
- inner,
+ _inner: inner,
http,
created_at: Instant::now(),
});
diff --git a/crates/screenpipe-redact/src/adapters/tinfoil_image.rs b/crates/screenpipe-redact/src/adapters/tinfoil_image.rs
index d23a71698..bd26ac05d 100644
--- a/crates/screenpipe-redact/src/adapters/tinfoil_image.rs
+++ b/crates/screenpipe-redact/src/adapters/tinfoil_image.rs
@@ -99,8 +99,7 @@ pub struct TinfoilImageConfig {
/// See sibling `tinfoil::CachedClient` for the rationale on holding
/// the verifier alongside the bare reqwest client.
struct CachedClient {
- #[allow(dead_code)]
- inner: tinfoil::Client,
+ _inner: tinfoil::Client,
http: reqwest::Client,
created_at: Instant,
}
@@ -226,7 +225,7 @@ impl TinfoilImageRedactor {
.clone();
let http_clone = http.clone();
*g = Some(CachedClient {
- inner,
+ _inner: inner,
http,
created_at: Instant::now(),
});
@@ -255,10 +254,6 @@ struct DetectRequest<'a> {
#[derive(Debug, Deserialize)]
struct DetectResponse {
detections: Vec<RawDetection>,
- #[allow(dead_code)]
- latency_ms: Option<f32>,
- #[allow(dead_code)]
- model: Option<String>,
}
#[derive(Debug, Deserialize)]
diff --git a/crates/screenpipe-redact/src/image/worker.rs b/crates/screenpipe-redact/src/image/worker.rs
index 277e238b4..4a608da60 100644
--- a/crates/screenpipe-redact/src/image/worker.rs
+++ b/crates/screenpipe-redact/src/image/worker.rs
@@ -166,7 +166,7 @@ impl ImageWorker {
let result = match shutdown.as_ref() {
Some(n) => tokio::select! {
- r = self.process_one() => Some(r),
+ _r = self.process_one() => Some(_r),
_ = n.notified() => None,
},
None => Some(self.process_one().await),
diff --git a/crates/screenpipe-redact/src/worker/mod.rs b/crates/screenpipe-redact/src/worker/mod.rs
index 220318e49..eeb25f538 100644
--- a/crates/screenpipe-redact/src/worker/mod.rs
+++ b/crates/screenpipe-redact/src/worker/mod.rs
@@ -175,7 +175,7 @@ impl Worker {
// doesn't hold us through tokio teardown.
let result = match shutdown.as_ref() {
Some(n) => tokio::select! {
- r = self.process_table(*table) => Some(r),
+ _r = self.process_table(*table) => Some(_r),
_ = n.notified() => None,
},
None => Some(self.process_table(*table).await),