From 1e7aabcae1b2139aa20a80fbf303c74388933f55 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 6 Jun 2026 15:16:07 +0900 Subject: fix(array-dumper): emit package links and require Link pretty constraint Resolve the phase-b TODO that left the supported-link-types loop as dead code (links were always an empty Vec), so requires/conflicts/provides/ replaces/require-dev are dumped again via PackageInterface::get_links_for_type, matching the PHP magic-call loop. Every Link in production is constructed with a pretty constraint (all ArrayLoader/AliasPackage/PlatformRepository/InstalledRepository sites pass one), so make Link::pretty_constraint a required String instead of Option. get_pretty_constraint() now returns &str directly rather than anyhow::Result<&str>, dropping the unreachable UnexpectedValueException guard, and all call sites are updated. Co-Authored-By: Claude Opus 4.8 --- crates/shirabe/src/package/locker.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/src/package/locker.rs') diff --git a/crates/shirabe/src/package/locker.rs b/crates/shirabe/src/package/locker.rs index 47a9974..51177db 100644 --- a/crates/shirabe/src/package/locker.rs +++ b/crates/shirabe/src/package/locker.rs @@ -957,7 +957,7 @@ impl Locker { if PlatformRepository::is_platform_package(&link.get_target()) { continue; } - if link.get_pretty_constraint().ok() == Some("self.version") { + if link.get_pretty_constraint() == "self.version" { continue; } if installed_repo @@ -995,7 +995,6 @@ impl Locker { PhpMixed::String( provider_link .get_pretty_constraint() - .unwrap_or_default() .to_string(), ), PhpMixed::String(format!( @@ -1015,7 +1014,7 @@ impl Locker { set.description, link.get_target(), description, - link.get_pretty_constraint().unwrap_or_default() + link.get_pretty_constraint(), )); } else { missing_requirement_info.push(format!( -- cgit v1.3.1