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_server/settings.rs | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'crates/turtle/src/atuin_server/settings.rs') diff --git a/crates/turtle/src/atuin_server/settings.rs b/crates/turtle/src/atuin_server/settings.rs index 2bce0dac..1d0ac2d0 100644 --- a/crates/turtle/src/atuin_server/settings.rs +++ b/crates/turtle/src/atuin_server/settings.rs @@ -7,11 +7,11 @@ use fs_err::{File, create_dir_all}; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Metrics { +pub(crate) struct Metrics { #[serde(alias = "enabled")] - pub enable: bool, - pub host: String, - pub port: u16, + pub(crate) enable: bool, + pub(crate) host: String, + pub(crate) port: u16, } impl Default for Metrics { @@ -25,35 +25,35 @@ impl Default for Metrics { } #[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Settings { - pub host: String, - pub port: u16, - pub path: String, - pub open_registration: bool, - pub max_history_length: usize, - pub max_record_size: usize, - pub page_size: i64, - pub register_webhook_url: Option, - pub register_webhook_username: String, - pub metrics: Metrics, +pub(crate) struct Settings { + pub(crate) host: String, + pub(crate) port: u16, + pub(crate) path: String, + pub(crate) open_registration: bool, + pub(crate) max_history_length: usize, + pub(crate) max_record_size: usize, + pub(crate) page_size: i64, + pub(crate) register_webhook_url: Option, + pub(crate) register_webhook_username: String, + pub(crate) metrics: Metrics, /// Enable legacy sync v1 routes (history-based sync) /// Set to false to use only the newer record-based sync - pub sync_v1_enabled: bool, + pub(crate) sync_v1_enabled: bool, /// Advertise a version that is not what we are _actually_ running /// Many clients compare their version with api.atuin.sh, and if they differ, notify the user /// that an update is available. /// Now that we take beta releases, we should be able to advertise a different version to avoid /// notifying users when the server runs something that is not a stable release. - pub fake_version: Option, + pub(crate) fake_version: Option, #[serde(flatten)] - pub db_settings: DbSettings, + pub(crate) db_settings: DbSettings, } impl Settings { - pub fn new() -> Result { + pub(crate) fn new() -> Result { let mut config_file = if let Ok(p) = std::env::var("ATUIN_CONFIG_DIR") { PathBuf::from(p) } else { -- cgit v1.3.1