From dc15a0d66642244870abd839bc172388c08e96be Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 31 May 2026 20:00:58 +0900 Subject: feat(installer): downcast UpdateOperation in download/execute batches --- .../shirabe/src/installer/installation_manager.rs | 27 ++++++++-------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/crates/shirabe/src/installer/installation_manager.rs b/crates/shirabe/src/installer/installation_manager.rs index 26fe84f..31cc23c 100644 --- a/crates/shirabe/src/installer/installation_manager.rs +++ b/crates/shirabe/src/installer/installation_manager.rs @@ -308,17 +308,13 @@ impl InstallationManager { let package: PackageInterfaceHandle; let initial_package: Option; - // TODO(phase-b): downcast for UpdateOperation / Install/Mark/Uninstall variants - let update_op: Option<&UpdateOperation> = None; if op_type == "update" { // @var UpdateOperation $operation - if let Some(_u) = update_op { - // TODO(phase-c): bridge UpdateOperation handles (target/initial) into the - // &dyn PackageInterface that the installer APIs still expect. - continue; - } else { - continue; - } + let update_op = operation + .as_update_operation() + .expect("op_type == \"update\" implies UpdateOperation"); + package = update_op.get_target_package(); + initial_package = Some(update_op.get_initial_package()); } else { // @var InstallOperation|MarkAliasInstalledOperation|MarkAliasUninstalledOperation|UninstallOperation $operation package = operation.get_package(); @@ -451,15 +447,12 @@ impl InstallationManager { let package: PackageInterfaceHandle; let initial_package: Option; - let update_op: Option<&UpdateOperation> = None; if op_type == "update" { - if let Some(_u) = update_op { - // TODO(phase-c): bridge UpdateOperation handles (target/initial) into the - // &dyn PackageInterface that the installer APIs still expect. - continue; - } else { - continue; - } + let update_op = operation + .as_update_operation() + .expect("op_type == \"update\" implies UpdateOperation"); + package = update_op.get_target_package(); + initial_package = Some(update_op.get_initial_package()); } else { package = operation.get_package(); initial_package = None; -- cgit v1.3.1