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/command/init_command.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'crates/shirabe/src/command/init_command.rs') diff --git a/crates/shirabe/src/command/init_command.rs b/crates/shirabe/src/command/init_command.rs index 7e6021a9..c348fa6f 100644 --- a/crates/shirabe/src/command/init_command.rs +++ b/crates/shirabe/src/command/init_command.rs @@ -125,10 +125,7 @@ impl InitCommand { .into()) } - pub(crate) fn format_authors( - &self, - author: &str, - ) -> anyhow::Result>> { + fn format_authors(&self, author: &str) -> anyhow::Result>> { let parsed = self.parse_author_string(author)?; let mut author_map: IndexMap = IndexMap::new(); let name = parsed.get("name").cloned().unwrap_or(None); @@ -163,7 +160,7 @@ impl InitCommand { Some(implode("\\", &namespace)) } - pub(crate) fn get_git_config(&self) -> IndexMap { + fn get_git_config(&self) -> IndexMap { if self.git_config.borrow().is_some() { return self.git_config.borrow().clone().unwrap_or_default(); } @@ -208,7 +205,7 @@ impl InitCommand { /// "/$vendor/" /// "/$vendor/*" /// "$vendor/*" - pub(crate) fn has_vendor_ignore(&self, ignore_file: &str, vendor: &str) -> bool { + fn has_vendor_ignore(&self, ignore_file: &str, vendor: &str) -> bool { if !file_exists(ignore_file) { return false; } @@ -225,7 +222,7 @@ impl InitCommand { false } - pub(crate) fn add_vendor_ignore(&self, ignore_file: &str, vendor: &str) { + fn add_vendor_ignore(&self, ignore_file: &str, vendor: &str) { let mut contents = String::new(); if file_exists(ignore_file) { contents = file_get_contents(ignore_file).unwrap_or_default(); @@ -269,7 +266,7 @@ impl InitCommand { self.add_vendor_ignore(ignore_file, vendor) } - pub(crate) fn is_valid_email(&self, email: &str) -> bool { + fn is_valid_email(&self, email: &str) -> bool { shirabe_php_shim::filter_var_email(email) } -- cgit v1.3.1-4-g156e