aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/dependency_resolver/problem.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/problem.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/problem.rs')
-rw-r--r--crates/shirabe/src/dependency_resolver/problem.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/shirabe/src/dependency_resolver/problem.rs b/crates/shirabe/src/dependency_resolver/problem.rs
index 1da6028c..cdb833bf 100644
--- a/crates/shirabe/src/dependency_resolver/problem.rs
+++ b/crates/shirabe/src/dependency_resolver/problem.rs
@@ -25,12 +25,12 @@ use shirabe_symfony_console::formatter::OutputFormatter;
#[derive(Debug)]
pub struct Problem {
/// A map containing the id of each rule part of this problem as a key
- pub(crate) reason_seen: IndexMap<String, bool>,
+ reason_seen: IndexMap<String, bool>,
/// A set of reasons for the problem, each is a rule or a root require and a rule
- pub(crate) reasons: IndexMap<i64, Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
+ reasons: IndexMap<i64, Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
- pub(crate) section: i64,
+ section: i64,
}
impl Default for Problem {
@@ -360,7 +360,7 @@ impl Problem {
}
/// Store a reason descriptor but ignore duplicates
- pub(crate) fn add_reason(&mut self, id: String, reason: std::rc::Rc<std::cell::RefCell<Rule>>) {
+ fn add_reason(&mut self, id: String, reason: std::rc::Rc<std::cell::RefCell<Rule>>) {
// TODO: if a rule is part of a problem description in two sections, isn't this going to remove a message
// that is important to understand the issue?
@@ -1377,7 +1377,7 @@ impl Problem {
}
/// Turns a constraint into text usable in a sentence describing a request
- pub(crate) fn constraint_to_text(constraint: Option<&AnyConstraint>) -> String {
+ fn constraint_to_text(constraint: Option<&AnyConstraint>) -> String {
if let Some(c) = constraint
&& c.is_constraint()
&& c.get_operator() == Some(CmpOp::Eq)