From 26daafaae3713cd94ce32354e6404d95e06c568c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 3 Jun 2026 01:57:34 +0900 Subject: feat(downcast): wire package/repo/filter instanceof checks via existing handle/as_any Resolve three category-4 TODO(phase-b) placeholders that were short-circuited to None/true, by routing them through downcast mechanisms that already exist: - package_sorter: PackageInterfaceHandle::as_root() for the instanceof RootPackageInterface check that adds dev-requires - platform_repository::is_complete_package: as_complete().is_some(), consistent with the inlined check already in add_package - create_project_command: PlatformRequirementFilterInterface::as_any() downcast to IgnoreAllPlatformRequirementFilter No new trait infrastructure introduced. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/util/package_sorter.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crates/shirabe/src/util') diff --git a/crates/shirabe/src/util/package_sorter.rs b/crates/shirabe/src/util/package_sorter.rs index 9db56f5..97b2561 100644 --- a/crates/shirabe/src/util/package_sorter.rs +++ b/crates/shirabe/src/util/package_sorter.rs @@ -6,7 +6,6 @@ use shirabe_php_shim::{strnatcasecmp, version_compare}; use crate::package::Link; use crate::package::PackageInterface; use crate::package::PackageInterfaceHandle; -use crate::package::RootPackage; pub struct PackageSorter; @@ -47,9 +46,7 @@ impl PackageSorter { for package in &packages { let mut links: IndexMap = package.get_requires(); - // TODO(phase-b): check for RootAliasPackage as well; PackageInterface lacks as_any - let root_package: Option<&RootPackage> = None; - if let Some(root_package) = root_package { + if let Some(root_package) = package.as_root() { links.extend(root_package.get_dev_requires()); } for link in links.values() { -- cgit v1.3.1