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/repository/vcs/svn_driver.rs | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'crates/shirabe/src/repository/vcs/svn_driver.rs') diff --git a/crates/shirabe/src/repository/vcs/svn_driver.rs b/crates/shirabe/src/repository/vcs/svn_driver.rs index 6d767af5..dd74400d 100644 --- a/crates/shirabe/src/repository/vcs/svn_driver.rs +++ b/crates/shirabe/src/repository/vcs/svn_driver.rs @@ -21,25 +21,25 @@ use shirabe_php_shim::{ #[derive(Debug)] pub struct SvnDriver { - pub(crate) inner: VcsDriverBase, + inner: VcsDriverBase, /// @var string - pub(crate) base_url: String, + base_url: String, /// @var array Map of tag name to identifier - pub(crate) tags: Option>, + tags: Option>, /// @var array Map of branch name to identifier - pub(crate) branches: Option>, + branches: Option>, /// @var ?string - pub(crate) root_identifier: Option, + root_identifier: Option, - pub(crate) trunk_path: Option, + trunk_path: Option, /// @var string - pub(crate) branches_path: String, + branches_path: String, /// @var string - pub(crate) tags_path: String, + tags_path: String, /// @var string - pub(crate) package_path: String, + package_path: String, /// @var bool - pub(crate) cache_credentials: bool, + cache_credentials: bool, /// @var SvnUtil util: Option, @@ -152,7 +152,7 @@ impl SvnDriver { None } - pub(crate) fn should_cache(&self, identifier: &str) -> bool { + fn should_cache(&self, identifier: &str) -> bool { self.inner.cache.is_some() && Preg::is_match(php_regex!(r"{@\d+$}"), identifier) } @@ -530,7 +530,7 @@ impl SvnDriver { } /// An absolute path (leading '/') is converted to a file:// url. - pub(crate) fn normalize_url(url: &str) -> String { + fn normalize_url(url: &str) -> String { let fs = Filesystem::new(None); if fs.is_absolute_path(url) { return format!("file://{}", strtr(url, "\\", "/")); @@ -545,7 +545,7 @@ impl SvnDriver { /// @param non-empty-list $command The svn command to run. /// @param string $url The SVN URL. /// @throws \RuntimeException - pub(crate) fn execute(&mut self, command: Vec, url: &str) -> anyhow::Result { + fn execute(&mut self, command: Vec, url: &str) -> anyhow::Result { if self.util.is_none() { self.util = Some(SvnUtil::new( self.base_url.clone(), @@ -589,7 +589,7 @@ impl SvnDriver { /// /// @param string $baseDir The path to trunk/branch/tag /// @param int $revision The revision mark to add to identifier - pub(crate) fn build_identifier(&self, base_dir: &str, revision: i64) -> String { + fn build_identifier(&self, base_dir: &str, revision: i64) -> String { format!( "{}{}/@{}", base_dir.trim_end_matches('/'), -- cgit v1.3.1-4-g156e