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/command/audit_command.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/src/command/audit_command.rs') diff --git a/crates/shirabe/src/command/audit_command.rs b/crates/shirabe/src/command/audit_command.rs index ec8b495..5868b15 100644 --- a/crates/shirabe/src/command/audit_command.rs +++ b/crates/shirabe/src/command/audit_command.rs @@ -3,7 +3,7 @@ use crate::advisory::AuditConfig; use crate::advisory::Auditor; use crate::command::{BaseCommand, BaseCommandData, HasBaseCommandData}; -use crate::composer::PartialComposerHandle; +use crate::composer::{AnyComposerHandle, Composer, PartialComposer}; use crate::console::input::InputOption; use crate::io::IOInterface; use crate::io::IOInterfaceImmutable; @@ -144,10 +144,10 @@ impl AuditCommand { fn get_packages( &self, - composer: &PartialComposerHandle, + composer: &AnyComposerHandle, input: &dyn InputInterface, ) -> Result> { - let mut composer = crate::command::composer_full_mut(composer); + let composer = crate::command::composer_full(composer); if input.get_option("locked").as_bool().unwrap_or(false) { let locker = composer.get_locker().clone(); let mut locker = locker.borrow_mut(); -- cgit v1.3.1