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/command/client/config.rs | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'crates/turtle/src/command/client/config.rs') diff --git a/crates/turtle/src/command/client/config.rs b/crates/turtle/src/command/client/config.rs index 1597a8d6..73d1c35e 100644 --- a/crates/turtle/src/command/client/config.rs +++ b/crates/turtle/src/command/client/config.rs @@ -5,7 +5,7 @@ use toml_edit::{Document, DocumentMut, Item, Table, TableLike, Value}; #[derive(Subcommand, Debug)] #[command(infer_subcommands = true)] -pub enum Cmd { +pub(crate) enum Cmd { /// Get a configuration value from your config.toml file /// or after defaults and overrides are applied #[command()] @@ -24,7 +24,7 @@ pub enum Cmd { } impl Cmd { - pub async fn run(self, settings: &Settings) -> Result<()> { + pub(crate) async fn run(self, settings: &Settings) -> Result<()> { match self { Self::Get(get) => get.run(settings).await, Self::Set(set) => set.run(settings).await, @@ -36,21 +36,21 @@ impl Cmd { /// Get a configuration value from your config.toml file, /// or optionally the effective value after defaults and overrides are applied. #[derive(Args, Debug)] -pub struct GetCmd { +pub(crate) struct GetCmd { /// The configuration key to get - pub key: String, + pub(crate) key: String, /// Print the value after defaults and overrides are applied #[arg(long, short)] - pub resolved: bool, + pub(crate) resolved: bool, /// Print both the config file value and the resolved value #[arg(long, short)] - pub verbose: bool, + pub(crate) verbose: bool, } impl GetCmd { - pub async fn run(&self, _settings: &Settings) -> Result<()> { + pub(crate) async fn run(&self, _settings: &Settings) -> Result<()> { let key = self.key.trim(); if key.is_empty() || key.contains(char::is_whitespace) { eyre::bail!("Config key must be non-empty and must not contain whitespace"); @@ -116,20 +116,20 @@ impl GetCmd { } #[derive(Args, Debug)] -pub struct SetCmd { +pub(crate) struct SetCmd { /// The configuration key to set - pub key: String, + pub(crate) key: String, /// The value to set - pub value: String, + pub(crate) value: String, /// Store value as an explicit type #[arg(long = "type", short, value_enum, default_value_t = ValueType::Auto, value_name = "TYPE")] - pub the_type: ValueType, + pub(crate) the_type: ValueType, } #[derive(ValueEnum, Debug, Clone, PartialEq, Eq)] -pub enum ValueType { +pub(crate) enum ValueType { /// Automatically determine the type of the value Auto, /// Store value as a string @@ -143,7 +143,7 @@ pub enum ValueType { } impl SetCmd { - pub async fn run(self, _settings: &Settings) -> Result<()> { + pub(crate) async fn run(self, _settings: &Settings) -> Result<()> { let key = self.key.trim(); if key.is_empty() || key.contains(char::is_whitespace) { eyre::bail!("Config key must be non-empty and must not contain whitespace"); @@ -213,13 +213,13 @@ impl SetCmd { } #[derive(Args, Debug)] -pub struct PrintCmd { +pub(crate) struct PrintCmd { /// Print the value of a specific key and all its children - pub key: Option, + pub(crate) key: Option, } impl PrintCmd { - pub async fn run(&self, _settings: &Settings) -> Result<()> { + pub(crate) async fn run(&self, _settings: &Settings) -> Result<()> { let config_file = Settings::get_config_path()?; let config_str = tokio::fs::read_to_string(&config_file).await?; let doc = config_str.parse::>()?; -- cgit v1.3.1