From c7f53c5d7d581ebf76803650c63ec615b1558dc8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 28 May 2026 03:31:41 +0900 Subject: refactor(composer): represent composer via trait-based handles Replace the PartialComposer/Composer structs and the single Rc> enum with PartialComposer and Composer traits (Composer: PartialComposer), InnerPartialComposer / InnerFullComposer data structs, and the handle types FullComposerHandle (impl Composer) and AnyComposerHandle (polymorphic enum, impl PartialComposer), plus their weak variants. Factory builds the full and partial graphs via separate Rc::new_cyclic branches that share a build_composer_base helper. Call sites now use trait methods that encapsulate borrowing instead of borrow_partial() / composer_full*(). Co-Authored-By: Claude Opus 4.7 --- crates/shirabe/src/installer/installer_event.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/installer/installer_event.rs') diff --git a/crates/shirabe/src/installer/installer_event.rs b/crates/shirabe/src/installer/installer_event.rs index 5adde1c..00a0096 100644 --- a/crates/shirabe/src/installer/installer_event.rs +++ b/crates/shirabe/src/installer/installer_event.rs @@ -1,6 +1,6 @@ //! ref: composer/src/Composer/Installer/InstallerEvent.php -use crate::composer::ComposerWeakHandle; +use crate::composer::FullComposerWeakHandle; use crate::dependency_resolver::Transaction; use crate::event_dispatcher::Event; use crate::io::IOInterface; @@ -8,7 +8,7 @@ use crate::io::IOInterface; #[derive(Debug)] pub struct InstallerEvent { inner: Event, - composer: ComposerWeakHandle, + composer: FullComposerWeakHandle, io: std::rc::Rc>, dev_mode: bool, execute_operations: bool, @@ -18,7 +18,7 @@ pub struct InstallerEvent { impl InstallerEvent { pub fn new( event_name: String, - composer: ComposerWeakHandle, + composer: FullComposerWeakHandle, io: std::rc::Rc>, dev_mode: bool, execute_operations: bool, @@ -35,7 +35,7 @@ impl InstallerEvent { } } - pub fn get_composer(&self) -> &ComposerWeakHandle { + pub fn get_composer(&self) -> &FullComposerWeakHandle { &self.composer } -- cgit v1.3.1