diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-16 00:59:54 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-16 01:03:45 +0900 |
| commit | 3a388b98a9aa6a14b1c7f7dc909c109cf9837800 (patch) | |
| tree | 593e342313c6e6bd3ec2943a1690b8798e0a83ae /crates/shirabe/src/repository/vcs/svn_driver.rs | |
| parent | aad468e8b75ffc3e87ea6dfa22c53a8299fc08da (diff) | |
| download | php-shirabe-3a388b98a9aa6a14b1c7f7dc909c109cf9837800.tar.gz php-shirabe-3a388b98a9aa6a14b1c7f7dc909c109cf9837800.tar.zst php-shirabe-3a388b98a9aa6a14b1c7f7dc909c109cf9837800.zip | |
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/repository/vcs/svn_driver.rs')
| -rw-r--r-- | crates/shirabe/src/repository/vcs/svn_driver.rs | 28 |
1 files changed, 14 insertions, 14 deletions
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<int|string, string> Map of tag name to identifier - pub(crate) tags: Option<IndexMap<String, String>>, + tags: Option<IndexMap<String, String>>, /// @var array<int|string, string> Map of branch name to identifier - pub(crate) branches: Option<IndexMap<String, String>>, + branches: Option<IndexMap<String, String>>, /// @var ?string - pub(crate) root_identifier: Option<String>, + root_identifier: Option<String>, - pub(crate) trunk_path: Option<String>, + trunk_path: Option<String>, /// @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<SvnUtil>, @@ -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<string> $command The svn command to run. /// @param string $url The SVN URL. /// @throws \RuntimeException - pub(crate) fn execute(&mut self, command: Vec<String>, url: &str) -> anyhow::Result<String> { + fn execute(&mut self, command: Vec<String>, url: &str) -> anyhow::Result<String> { 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('/'), |
