From 3a388b98a9aa6a14b1c7f7dc909c109cf9837800 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 16 Aug 2026 00:59:54 +0900 Subject: refactor: narrow pub(crate) items to private Porting mapped every PHP `protected` member onto `pub(crate)`, which is wider than nearly all of them need. Each item demoted here is reached only from the module that defines it, so the crate-wide visibility conveyed nothing. Every `pub(crate)` that survives has at least one reader in another module of the same crate. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/util/svn.rs | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'crates/shirabe/src/util/svn.rs') diff --git a/crates/shirabe/src/util/svn.rs b/crates/shirabe/src/util/svn.rs index 395f176f..bde2583d 100644 --- a/crates/shirabe/src/util/svn.rs +++ b/crates/shirabe/src/util/svn.rs @@ -23,21 +23,21 @@ pub struct SvnCredentials { #[derive(Debug)] pub struct Svn { /// @var ?array{username: string, password: string} - pub(crate) credentials: Option, + credentials: Option, /// @var bool - pub(crate) has_auth: Option, + has_auth: Option, /// @var IOInterface - pub(crate) io: std::rc::Rc>, + io: std::rc::Rc>, /// @var string - pub(crate) url: String, + url: String, /// @var bool - pub(crate) cache_credentials: bool, + cache_credentials: bool, /// @var ProcessExecutor - pub(crate) process: std::rc::Rc>, + process: std::rc::Rc>, /// @var int - pub(crate) qty_auth_tries: i64, + qty_auth_tries: i64, /// @var Config - pub(crate) config: std::rc::Rc>, + config: std::rc::Rc>, } /// @var string|null @@ -202,7 +202,7 @@ impl Svn { /// Repositories requests credentials, let's put them in. /// /// @throws \RuntimeException - pub(crate) fn do_auth_dance(&mut self) -> anyhow::Result<&mut Self> { + fn do_auth_dance(&mut self) -> anyhow::Result<&mut Self> { // cannot ask for credentials in non interactive mode if !self.io.is_interactive() { return Err(RuntimeException::new( @@ -247,12 +247,7 @@ impl Svn { /// @param non-empty-list $cmd Usually 'svn ls' or something like that. /// @param string $url Repo URL. /// @param string $path Target for a checkout - pub(crate) fn get_command( - &mut self, - mut cmd: Vec, - url: &str, - path: Option<&str>, - ) -> Vec { + fn get_command(&mut self, mut cmd: Vec, url: &str, path: Option<&str>) -> Vec { cmd.push("--non-interactive".to_string()); cmd.extend(self.get_credential_args()); cmd.push("--".to_string()); @@ -268,7 +263,7 @@ impl Svn { /// Return the credential string for the svn command. /// /// Adds --no-auth-cache when credentials are present. - pub(crate) fn get_credential_args(&mut self) -> Vec { + fn get_credential_args(&mut self) -> Vec { if !self.has_auth() { return vec![]; } @@ -299,7 +294,7 @@ impl Svn { /// Get the password for the svn command. Can be empty. /// /// @throws \LogicException - pub(crate) fn get_password(&self) -> anyhow::Result { + fn get_password(&self) -> anyhow::Result { if self.credentials.is_none() { return Err(LogicException::new("No svn auth detected.".to_string()).into()); } @@ -310,7 +305,7 @@ impl Svn { /// Get the username for the svn command. /// /// @throws \LogicException - pub(crate) fn get_username(&self) -> anyhow::Result { + fn get_username(&self) -> anyhow::Result { if self.credentials.is_none() { return Err(LogicException::new("No svn auth detected.".to_string()).into()); } @@ -319,7 +314,7 @@ impl Svn { } /// Detect Svn Auth. - pub(crate) fn has_auth(&mut self) -> bool { + fn has_auth(&mut self) -> bool { if let Some(has_auth) = self.has_auth { return has_auth; } @@ -332,7 +327,7 @@ impl Svn { } /// Return the no-auth-cache switch. - pub(crate) fn get_auth_cache_args(&self) -> Vec { + fn get_auth_cache_args(&self) -> Vec { if self.cache_credentials { vec![] } else { -- cgit v1.3.1-4-g156e