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/plugin.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'crates/turtle/src/atuin_client/plugin.rs') diff --git a/crates/turtle/src/atuin_client/plugin.rs b/crates/turtle/src/atuin_client/plugin.rs index 6f351bf1..e97b1dbf 100644 --- a/crates/turtle/src/atuin_client/plugin.rs +++ b/crates/turtle/src/atuin_client/plugin.rs @@ -1,14 +1,14 @@ use std::collections::HashMap; #[derive(Debug, Clone)] -pub struct OfficialPlugin { - pub name: String, - pub description: String, - pub install_message: String, +pub(crate) struct OfficialPlugin { + pub(crate) name: String, + pub(crate) description: String, + pub(crate) install_message: String, } impl OfficialPlugin { - pub fn new(name: &str, description: &str, install_message: &str) -> Self { + pub(crate) fn new(name: &str, description: &str, install_message: &str) -> Self { Self { name: name.to_string(), description: description.to_string(), @@ -17,12 +17,12 @@ impl OfficialPlugin { } } -pub struct OfficialPluginRegistry { +pub(crate) struct OfficialPluginRegistry { plugins: HashMap, } impl OfficialPluginRegistry { - pub fn new() -> Self { + pub(crate) fn new() -> Self { let mut registry = Self { plugins: HashMap::new(), }; @@ -47,15 +47,15 @@ impl OfficialPluginRegistry { ); } - pub fn get_plugin(&self, name: &str) -> Option<&OfficialPlugin> { + pub(crate) fn get_plugin(&self, name: &str) -> Option<&OfficialPlugin> { self.plugins.get(name) } - pub fn is_official_plugin(&self, name: &str) -> bool { + pub(crate) fn is_official_plugin(&self, name: &str) -> bool { self.plugins.contains_key(name) } - pub fn get_install_message(&self, name: &str) -> Option<&str> { + pub(crate) fn get_install_message(&self, name: &str) -> Option<&str> { self.plugins .get(name) .map(|plugin| plugin.install_message.as_str()) @@ -68,13 +68,13 @@ impl Default for OfficialPluginRegistry { } } -pub struct PluginContext { +pub(crate) struct PluginContext { #[cfg(windows)] _update_on_windows: Option, } impl PluginContext { - pub fn new(_subcommand: &str) -> Self { + pub(crate) fn new(_subcommand: &str) -> Self { PluginContext { #[cfg(windows)] _update_on_windows: (_subcommand == "update").then(UpdateOnWindowsContext::new), @@ -95,7 +95,7 @@ struct UpdateOnWindowsContext { impl UpdateOnWindowsContext { const OLD_FILE_NAME: &'static str = "atuin.old"; - pub fn new() -> Self { + pub(crate) fn new() -> Self { // Windows doesn't let you overwrite a running exe, but it lets you rename it, // so make some room for atuin-update to install the new version. let initial_exe = std::env::current_exe().ok().and_then(|exe| { -- cgit v1.3.1