aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/dependency_resolver/transaction.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-16 00:59:54 +0900
committernsfisis <nsfisis@gmail.com>2026-08-16 01:03:45 +0900
commit3a388b98a9aa6a14b1c7f7dc909c109cf9837800 (patch)
tree593e342313c6e6bd3ec2943a1690b8798e0a83ae /crates/shirabe/src/dependency_resolver/transaction.rs
parentaad468e8b75ffc3e87ea6dfa22c53a8299fc08da (diff)
downloadphp-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/dependency_resolver/transaction.rs')
-rw-r--r--crates/shirabe/src/dependency_resolver/transaction.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/shirabe/src/dependency_resolver/transaction.rs b/crates/shirabe/src/dependency_resolver/transaction.rs
index 78037338..84879a41 100644
--- a/crates/shirabe/src/dependency_resolver/transaction.rs
+++ b/crates/shirabe/src/dependency_resolver/transaction.rs
@@ -21,18 +21,18 @@ use shirabe_php_shim::{
#[derive(Debug, Clone)]
pub struct Transaction {
/// @var OperationInterface[]
- pub(crate) operations: Vec<AnyOperation>,
+ operations: Vec<AnyOperation>,
/// Packages present at the beginning of the transaction
/// @var PackageInterface[]
- pub(crate) present_packages: Vec<PackageInterfaceHandle>,
+ present_packages: Vec<PackageInterfaceHandle>,
/// Package set resulting from this transaction
/// @var array<string, PackageInterface>
- pub(crate) result_package_map: IndexMap<String, PackageInterfaceHandle>,
+ result_package_map: IndexMap<String, PackageInterfaceHandle>,
/// @var array<string, PackageInterface[]>
- pub(crate) result_packages_by_name: IndexMap<String, Vec<PackageInterfaceHandle>>,
+ result_packages_by_name: IndexMap<String, Vec<PackageInterfaceHandle>>,
}
impl Default for Transaction {
@@ -104,7 +104,7 @@ impl Transaction {
}
}
- pub(crate) fn calculate_operations(&mut self) -> Vec<AnyOperation> {
+ fn calculate_operations(&mut self) -> Vec<AnyOperation> {
let mut operations: Vec<AnyOperation> = vec![];
let mut present_package_map: IndexMap<String, PackageInterfaceHandle> = IndexMap::new();
@@ -218,7 +218,7 @@ impl Transaction {
///
/// These serve as a starting point to enumerate packages in a topological order despite potential cycles.
/// If there are packages with a cycle on the top level the package with the lowest name gets picked
- pub(crate) fn get_root_packages(&self) -> IndexMap<String, PackageInterfaceHandle> {
+ fn get_root_packages(&self) -> IndexMap<String, PackageInterfaceHandle> {
let mut roots: IndexMap<String, PackageInterfaceHandle> = self
.result_package_map
.iter()
@@ -245,7 +245,7 @@ impl Transaction {
roots
}
- pub(crate) fn get_providers_in_result(&self, link: &Link) -> Vec<PackageInterfaceHandle> {
+ fn get_providers_in_result(&self, link: &Link) -> Vec<PackageInterfaceHandle> {
let Some(packages) = self.result_packages_by_name.get(link.get_target()) else {
return vec![];
};