From 0328797bcea16faa213f11b46154f5f7a9bc1167 Mon Sep 17 00:00:00 2001 From: Vassiliy Yegorov Date: Tue, 9 Jun 2026 21:39:43 +0700 Subject: [PATCH] chore(daemon): remove unused imports and dead placeholders Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/spaceshd/src/persist.rs | 8 +------- crates/spaceshd/src/registry.rs | 1 - crates/spaceshd/src/server.rs | 2 +- crates/spaceshd/src/state_store.rs | 5 +---- crates/spaceshd/src/surface.rs | 1 + 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/crates/spaceshd/src/persist.rs b/crates/spaceshd/src/persist.rs index 3e6278f..796b1bd 100644 --- a/crates/spaceshd/src/persist.rs +++ b/crates/spaceshd/src/persist.rs @@ -1,12 +1,8 @@ use std::sync::Arc; -use std::sync::atomic::{AtomicUsize, Ordering}; use tokio::sync::mpsc; use tokio::time::{Duration, Instant}; use crate::state_store::{PersistState, StateStore}; -/// Debounce window: coalesce a burst of dirty signals into one save. -const DEBOUNCE: Duration = Duration::from_millis(500); - /// A handle the registry uses to request a persist. `mark_dirty(state)` records /// the latest snapshot and (re)arms the debounce timer. #[derive(Clone)] @@ -59,12 +55,10 @@ pub fn spawn(store: Arc, debounce: Duration) -> Persister { Persister { tx } } -#[allow(dead_code)] -fn _unused(_c: &AtomicUsize) {} - #[cfg(test)] mod tests { use super::*; + use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Mutex; struct CountingStore { diff --git a/crates/spaceshd/src/registry.rs b/crates/spaceshd/src/registry.rs index cc0aefe..cf47eb6 100644 --- a/crates/spaceshd/src/registry.rs +++ b/crates/spaceshd/src/registry.rs @@ -3,7 +3,6 @@ use std::path::PathBuf; use std::sync::atomic::{AtomicU64, Ordering}; use spacesh_proto::ids::{GroupId, SurfaceId, WorkspaceId}; -use spacesh_proto::layout::LayoutNode; use spacesh_proto::workspace::{Group, SurfaceSpec, SurfaceView, Workspace, WorkspaceView}; use crate::state_store::PersistState; diff --git a/crates/spaceshd/src/server.rs b/crates/spaceshd/src/server.rs index 978a81c..60759a6 100644 --- a/crates/spaceshd/src/server.rs +++ b/crates/spaceshd/src/server.rs @@ -181,7 +181,7 @@ async fn handle_request( exit_tx: &mpsc::UnboundedSender<(SurfaceId, i32)>, persister: &Persister, ) { - use spacesh_proto::message::{SplitDir, Edge}; + use spacesh_proto::message::SplitDir; use spacesh_proto::layout::{LayoutNode, Orient}; use spacesh_proto::workspace::SurfaceSpec; diff --git a/crates/spaceshd/src/state_store.rs b/crates/spaceshd/src/state_store.rs index 52ce86a..31ca3c4 100644 --- a/crates/spaceshd/src/state_store.rs +++ b/crates/spaceshd/src/state_store.rs @@ -1,4 +1,4 @@ -use std::path::{Path, PathBuf}; +use std::path::PathBuf; use anyhow::Result; use serde::{Deserialize, Serialize}; use spacesh_proto::workspace::{Group, Workspace}; @@ -69,9 +69,6 @@ impl StateStore for JsonStateStore { } } -#[allow(dead_code)] -fn touch(_p: &Path) {} - #[cfg(test)] mod tests { use super::*; diff --git a/crates/spaceshd/src/surface.rs b/crates/spaceshd/src/surface.rs index 0e739f4..b1a9620 100644 --- a/crates/spaceshd/src/surface.rs +++ b/crates/spaceshd/src/surface.rs @@ -41,6 +41,7 @@ pub enum SurfaceMsg { pub struct SurfaceHandle { pub id: SurfaceId, + #[allow(dead_code)] pub workspace_id: WorkspaceId, pub tx: mpsc::Sender, }