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/repository/platform_repository.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/src/repository/platform_repository.rs') diff --git a/crates/shirabe/src/repository/platform_repository.rs b/crates/shirabe/src/repository/platform_repository.rs index 957e335..3a59475 100644 --- a/crates/shirabe/src/repository/platform_repository.rs +++ b/crates/shirabe/src/repository/platform_repository.rs @@ -1775,7 +1775,7 @@ impl PlatformRepository { "lib-uuid".to_string(), SimpleConstraint::new("=".to_string(), version.to_string(), None).into(), Some(Link::TYPE_REPLACE.to_string()), - Some(ext.get_pretty_version().to_string()), + ext.get_pretty_version().to_string(), ), ); ext.inner.set_replaces(replaces); @@ -1840,7 +1840,7 @@ impl PlatformRepository { format!("lib-{}", replace_lower), SimpleConstraint::new("=".to_string(), version.to_string(), None).into(), Some(Link::TYPE_REPLACE.to_string()), - Some(lib.get_pretty_version().to_string()), + lib.get_pretty_version().to_string(), ), ); } @@ -1854,7 +1854,7 @@ impl PlatformRepository { format!("lib-{}", provide_lower), SimpleConstraint::new("=".to_string(), version.to_string(), None).into(), Some(Link::TYPE_PROVIDE.to_string()), - Some(lib.get_pretty_version().to_string()), + lib.get_pretty_version().to_string(), ), ); } -- cgit v1.3.1