From 199563550dd41c3dfb703bd3747604a8a03cdbc5 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 11 Jun 2026 14:20:49 +0200 Subject: chore: Remove all `pub`s They will not be marked by rustc/cargo as unused, and as atuin doesn't expose an API all of them _should_ be `pub(crate)` --- crates/turtle/src/atuin_daemon/components/history.rs | 8 ++++---- crates/turtle/src/atuin_daemon/components/mod.rs | 16 ++++++++-------- crates/turtle/src/atuin_daemon/components/search.rs | 12 ++++++------ crates/turtle/src/atuin_daemon/components/semantic.rs | 8 ++++---- crates/turtle/src/atuin_daemon/components/sync.rs | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) (limited to 'crates/turtle/src/atuin_daemon/components') diff --git a/crates/turtle/src/atuin_daemon/components/history.rs b/crates/turtle/src/atuin_daemon/components/history.rs index 95d34b69..ec41977f 100644 --- a/crates/turtle/src/atuin_daemon/components/history.rs +++ b/crates/turtle/src/atuin_daemon/components/history.rs @@ -36,7 +36,7 @@ const DAEMON_PROTOCOL_VERSION: u32 = 1; /// - Saves completed commands to the database and record store /// - Emits history events for other components (e.g., search indexing) /// - Provides the History gRPC service -pub struct HistoryComponent { +pub(crate) struct HistoryComponent { inner: Arc, } @@ -53,7 +53,7 @@ struct HistoryComponentInner { impl HistoryComponent { /// Create a new history component. - pub fn new() -> Self { + pub(crate) fn new() -> Self { Self { inner: Arc::new(HistoryComponentInner { running: DashMap::new(), @@ -66,7 +66,7 @@ impl HistoryComponent { /// Get the gRPC service for this component. /// /// This returns a tonic service that can be added to a gRPC server. - pub fn grpc_service(&self) -> HistoryServer { + pub(crate) fn grpc_service(&self) -> HistoryServer { HistoryServer::new(HistoryGrpcService { inner: self.inner.clone(), }) @@ -112,7 +112,7 @@ impl Component for HistoryComponent { /// The gRPC service implementation. /// /// This is a thin wrapper that delegates to the component's shared state. -pub struct HistoryGrpcService { +pub(crate) struct HistoryGrpcService { inner: Arc, } diff --git a/crates/turtle/src/atuin_daemon/components/mod.rs b/crates/turtle/src/atuin_daemon/components/mod.rs index 447e31df..5a93fbc1 100644 --- a/crates/turtle/src/atuin_daemon/components/mod.rs +++ b/crates/turtle/src/atuin_daemon/components/mod.rs @@ -14,12 +14,12 @@ //! - [`semantic::SemanticComponent`]: In-memory semantic command captures //! - [`sync::SyncComponent`]: Cloud sync -pub mod history; -pub mod search; -pub mod semantic; -pub mod sync; +pub(crate) mod history; +pub(crate) mod search; +pub(crate) mod semantic; +pub(crate) mod sync; -pub use history::HistoryComponent; -pub use search::SearchComponent; -pub use semantic::SemanticComponent; -pub use sync::SyncComponent; +pub(crate) use history::HistoryComponent; +pub(crate) use search::SearchComponent; +pub(crate) use semantic::SemanticComponent; +pub(crate) use sync::SyncComponent; diff --git a/crates/turtle/src/atuin_daemon/components/search.rs b/crates/turtle/src/atuin_daemon/components/search.rs index 85191cff..17decdad 100644 --- a/crates/turtle/src/atuin_daemon/components/search.rs +++ b/crates/turtle/src/atuin_daemon/components/search.rs @@ -34,7 +34,7 @@ const FRECENCY_REFRESH_INTERVAL_SECS: u64 = 60; /// - Loads history from the database on startup /// - Updates the index when history events occur /// - Provides the Search gRPC service -pub struct SearchComponent { +pub(crate) struct SearchComponent { index: Arc>, handle: tokio::sync::RwLock>, loader_handle: Option>, @@ -43,7 +43,7 @@ pub struct SearchComponent { impl SearchComponent { /// Create a new search component. - pub fn new() -> Self { + pub(crate) fn new() -> Self { Self { index: Arc::new(RwLock::new(SearchIndex::new())), handle: tokio::sync::RwLock::new(None), @@ -53,7 +53,7 @@ impl SearchComponent { } /// Get the gRPC service for this component. - pub fn grpc_service(&self) -> SearchServer { + pub(crate) fn grpc_service(&self) -> SearchServer { SearchServer::new(SearchGrpcService { index: self.index.clone(), }) @@ -273,7 +273,7 @@ impl Component for SearchComponent { } /// The gRPC service implementation. -pub struct SearchGrpcService { +pub(crate) struct SearchGrpcService { index: Arc>, } @@ -395,7 +395,7 @@ fn convert_filter_mode( } #[cfg(windows)] -pub fn with_trailing_slash(s: &str) -> String { +pub(crate) fn with_trailing_slash(s: &str) -> String { if s.ends_with('\\') { s.to_string() } else { @@ -404,7 +404,7 @@ pub fn with_trailing_slash(s: &str) -> String { } #[cfg(not(windows))] -pub fn with_trailing_slash(s: &str) -> String { +pub(crate) fn with_trailing_slash(s: &str) -> String { if s.ends_with('/') { s.to_string() } else { diff --git a/crates/turtle/src/atuin_daemon/components/semantic.rs b/crates/turtle/src/atuin_daemon/components/semantic.rs index a42fd5cb..052c2d73 100644 --- a/crates/turtle/src/atuin_daemon/components/semantic.rs +++ b/crates/turtle/src/atuin_daemon/components/semantic.rs @@ -29,7 +29,7 @@ const MAX_BYTES_PER_SESSION: usize = 32 * 1024 * 1024; const MAX_PENDING_HISTORIES: usize = 128; /// Stores completed command captures and associates them with history events. -pub struct SemanticComponent { +pub(crate) struct SemanticComponent { inner: Arc, } @@ -83,7 +83,7 @@ struct SemanticCommandRecord { } impl SemanticComponent { - pub fn new() -> Self { + pub(crate) fn new() -> Self { Self { inner: Arc::new(SemanticComponentInner { state: Mutex::new(SemanticState::default()), @@ -91,7 +91,7 @@ impl SemanticComponent { } } - pub fn grpc_service(&self) -> SemanticServer { + pub(crate) fn grpc_service(&self) -> SemanticServer { SemanticServer::new(SemanticGrpcService { inner: self.inner.clone(), }) @@ -452,7 +452,7 @@ impl Display for SessionId { } } -pub struct SemanticGrpcService { +pub(crate) struct SemanticGrpcService { inner: Arc, } diff --git a/crates/turtle/src/atuin_daemon/components/sync.rs b/crates/turtle/src/atuin_daemon/components/sync.rs index c76fb71b..93d1024a 100644 --- a/crates/turtle/src/atuin_daemon/components/sync.rs +++ b/crates/turtle/src/atuin_daemon/components/sync.rs @@ -41,14 +41,14 @@ enum SyncState { /// - Implements exponential backoff on sync failures /// - Responds to ForceSync events for immediate sync /// - Emits SyncCompleted/SyncFailed events -pub struct SyncComponent { +pub(crate) struct SyncComponent { task_handle: Option>, command_tx: Option>, } impl SyncComponent { /// Create a new sync component. - pub fn new() -> Self { + pub(crate) fn new() -> Self { Self { task_handle: None, command_tx: None, -- cgit v1.3.1