aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-registry/src/resolver.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-05 17:29:12 +0900
committernsfisis <nsfisis@gmail.com>2026-05-05 17:29:12 +0900
commit49b0884701a84731652fc934d428932ff6029bd4 (patch)
tree7477029b8ed686b9b3b06d960cab2b54ba87b579 /crates/mozart-registry/src/resolver.rs
parent4623874d1c95414dcd5ae194d2561f2d98b40982 (diff)
downloadphp-mozart-49b0884701a84731652fc934d428932ff6029bd4.tar.gz
php-mozart-49b0884701a84731652fc934d428932ff6029bd4.tar.zst
php-mozart-49b0884701a84731652fc934d428932ff6029bd4.zip
chore: remove redundant comments
Diffstat (limited to 'crates/mozart-registry/src/resolver.rs')
-rw-r--r--crates/mozart-registry/src/resolver.rs50
1 files changed, 0 insertions, 50 deletions
diff --git a/crates/mozart-registry/src/resolver.rs b/crates/mozart-registry/src/resolver.rs
index 5dbe74f..dc9c6dd 100644
--- a/crates/mozart-registry/src/resolver.rs
+++ b/crates/mozart-registry/src/resolver.rs
@@ -20,10 +20,6 @@ use mozart_sat_resolver::{
};
use mozart_semver::{Version, VersionConstraint};
-// ─────────────────────────────────────────────────────────────────────────────
-// Version helpers
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Strip a `@stability` suffix from a constraint string and return the
/// cleaned constraint plus the parsed stability. Mirrors Composer's
/// `RootPackageLoader::extractStabilityFlags` (single-constraint case):
@@ -355,10 +351,6 @@ fn strip_inline_reference(s: &str) -> String {
s.to_string()
}
-// ─────────────────────────────────────────────────────────────────────────────
-// PackageName
-// ─────────────────────────────────────────────────────────────────────────────
-
/// A normalized package name (lowercase, e.g. "monolog/monolog").
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PackageName(pub String);
@@ -387,10 +379,6 @@ impl PackageName {
}
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Platform configuration
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Platform package configuration.
/// Maps package names to version strings (normalized, e.g. "8.1.0.0").
pub struct PlatformConfig {
@@ -447,10 +435,6 @@ impl PlatformConfig {
}
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Error types
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Error returned by the public `resolve()` function.
#[derive(Debug)]
pub enum ResolveError {
@@ -490,10 +474,6 @@ impl fmt::Display for ResolveError {
impl std::error::Error for ResolveError {}
-// ─────────────────────────────────────────────────────────────────────────────
-// Stability filter
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Check if a version passes the minimum-stability filter for the given package.
fn passes_stability_filter(
package_name: &str,
@@ -526,10 +506,6 @@ fn should_skip_platform_dep(
.any(|p| mozart_core::matches_wildcard(dep_name, p))
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Packagist → PoolPackageInput conversion
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Mirrors `Composer\Package\CompletePackage::isAbandoned`: any
/// `abandoned: true` or `abandoned: "<replacement>"` value is truthy.
/// `abandoned: false` and an empty string both register as not-abandoned.
@@ -684,10 +660,6 @@ fn packagist_to_pool_inputs(
results
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Public API types
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Input to the resolver.
pub struct ResolveRequest {
/// Root package name from composer.json "name" field (e.g. "laravel/laravel").
@@ -831,10 +803,6 @@ pub struct ResolvedPackage {
pub alias_of_normalized: Option<String>,
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Public resolve() function
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Run the dependency resolver.
///
/// Returns a list of resolved packages (excluding root and platform packages),
@@ -1629,16 +1597,10 @@ pub async fn resolve(request: &ResolveRequest) -> Result<Vec<ResolvedPackage>, R
}
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Tests
-// ─────────────────────────────────────────────────────────────────────────────
-
#[cfg(test)]
mod tests {
use super::*;
- // ──────────── Version parsing helpers ────────────
-
fn v(major: u64, minor: u64, patch: u64, build: u64) -> Version {
Version {
major,
@@ -1663,8 +1625,6 @@ mod tests {
}
}
- // ──────────── parse_normalized ────────────
-
#[test]
fn test_parse_normalized_stable() {
let ver = parse_normalized("1.2.3.0").unwrap();
@@ -1787,8 +1747,6 @@ mod tests {
);
}
- // ──────────── PackageName ────────────
-
#[test]
fn test_package_name_is_platform() {
assert!(PackageName("php".to_string()).is_platform());
@@ -1807,8 +1765,6 @@ mod tests {
assert!(!PackageName("monolog/monolog".to_string()).is_root());
}
- // ──────────── Stability filter ────────────
-
#[test]
fn test_stability_filter() {
let stable_v = v(1, 0, 0, 0);
@@ -1914,8 +1870,6 @@ mod tests {
assert!(!should_skip_platform_dep("monolog/monolog", false, &list));
}
- // ──────────── Branch alias tests ────────────
-
#[test]
fn test_parse_branch_alias_target_x_dev() {
let ver = parse_branch_alias_target("2.x-dev").unwrap();
@@ -1944,8 +1898,6 @@ mod tests {
assert!(parse_branch_alias_target("").is_none());
}
- // ──────────── SAT solver integration tests (offline) ────────────
-
#[test]
fn test_sat_resolve_simple_offline() {
use mozart_sat_resolver::*;
@@ -1997,8 +1949,6 @@ mod tests {
assert!(result.installed.contains(&2));
}
- // ──────────── End-to-end tests (require network, marked #[ignore]) ────────────
-
#[tokio::test]
#[ignore]
async fn test_resolve_monolog_e2e() {