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_client/settings/meta.rs | 4 ++-- crates/turtle/src/atuin_client/settings/watcher.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/turtle/src/atuin_client/settings') diff --git a/crates/turtle/src/atuin_client/settings/meta.rs b/crates/turtle/src/atuin_client/settings/meta.rs index 450d0432..cc5afcf7 100644 --- a/crates/turtle/src/atuin_client/settings/meta.rs +++ b/crates/turtle/src/atuin_client/settings/meta.rs @@ -1,8 +1,8 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize, Clone)] -pub struct Settings { - pub db_path: String, +pub(crate) struct Settings { + pub(crate) db_path: String, } impl Default for Settings { diff --git a/crates/turtle/src/atuin_client/settings/watcher.rs b/crates/turtle/src/atuin_client/settings/watcher.rs index 7548573e..20082639 100644 --- a/crates/turtle/src/atuin_client/settings/watcher.rs +++ b/crates/turtle/src/atuin_client/settings/watcher.rs @@ -44,7 +44,7 @@ static SETTINGS_WATCHER: OnceLock> = OnceLock::n /// /// Initializes the watcher on first call. Subsequent calls return the same instance. /// The watcher monitors the config file for changes and broadcasts updates. -pub fn global_settings_watcher() -> Result<&'static SettingsWatcher> { +pub(crate) fn global_settings_watcher() -> Result<&'static SettingsWatcher> { let result = SETTINGS_WATCHER.get_or_init(|| SettingsWatcher::new().map_err(|e| e.to_string())); match result { @@ -57,7 +57,7 @@ pub fn global_settings_watcher() -> Result<&'static SettingsWatcher> { /// /// Uses `notify` for cross-platform file watching and `tokio::sync::watch` /// for efficient broadcast to multiple subscribers. -pub struct SettingsWatcher { +pub(crate) struct SettingsWatcher { /// Receiver for settings updates. Clone this to subscribe. rx: watch::Receiver>, /// Keeps the file watcher alive for the lifetime of this struct. @@ -69,7 +69,7 @@ impl SettingsWatcher { /// /// Loads initial settings and starts watching the config file for changes. /// Changes are debounced (500ms) to avoid multiple reloads during saves. - pub fn new() -> Result { + pub(crate) fn new() -> Result { let initial_settings = Arc::new(Settings::new()?); let (tx, rx) = watch::channel(initial_settings); @@ -89,12 +89,12 @@ impl SettingsWatcher { /// Returns a receiver that will be notified when settings change. /// Use `changed().await` to wait for the next update, then `borrow()` /// to access the current settings. - pub fn subscribe(&self) -> watch::Receiver> { + pub(crate) fn subscribe(&self) -> watch::Receiver> { self.rx.clone() } /// Get the current settings without subscribing to updates. - pub fn current(&self) -> Arc { + pub(crate) fn current(&self) -> Arc { self.rx.borrow().clone() } -- cgit v1.3.1