From 9a25fcfc82b72f60facd381786ca5490acca032c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 5 Jun 2026 02:42:02 +0900 Subject: feat(dependency-resolver): share operations via Rc, drop clone_box OperationInterface::clone_box (a todo!() trait-object clone stub) is removed in favor of Rc shared ownership. All its methods are &self, so operations are immutable value objects that Rc can share; pushing the same operation into multiple lists (installer's install/uninstall splits) becomes a cheap Rc clone instead of clone_box. Box is replaced with Rc across Transaction (and its Lock/LocalRepo wrappers), Installer, PackageEvent, InstallationManager and EventDispatcher; Box::new operation constructions become Rc::new. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/installer/package_event.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/shirabe/src/installer/package_event.rs') diff --git a/crates/shirabe/src/installer/package_event.rs b/crates/shirabe/src/installer/package_event.rs index 342732d..17f9113 100644 --- a/crates/shirabe/src/installer/package_event.rs +++ b/crates/shirabe/src/installer/package_event.rs @@ -14,8 +14,8 @@ pub struct PackageEvent { io: std::rc::Rc>, dev_mode: bool, local_repo: Box, - operations: Vec>, - operation: Box, + operations: Vec>, + operation: std::rc::Rc, } impl PackageEvent { @@ -25,8 +25,8 @@ impl PackageEvent { io: std::rc::Rc>, dev_mode: bool, local_repo: Box, - operations: Vec>, - operation: Box, + operations: Vec>, + operation: std::rc::Rc, ) -> Self { Self { inner: Event::new(event_name, vec![], IndexMap::new()), @@ -59,7 +59,7 @@ impl PackageEvent { self.local_repo.as_ref() } - pub fn get_operations(&self) -> &Vec> { + pub fn get_operations(&self) -> &Vec> { &self.operations } -- cgit v1.3.1