From 6d53dd16759df8b2cde09047ddcf460652034fd9 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 27 Jun 2026 04:52:00 +0900 Subject: refactor(command): replace composer_full_mut with shared composer_full The compiler confirms none of the call sites invoke a &mut self method on the returned Composer, so the exclusive RefMut borrow was never needed and only risked borrow check conflict. Switch every site to the shared composer_full borrow and drop the now-dead composer_full_mut helper. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/command/create_project_command.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/command/create_project_command.rs') diff --git a/crates/shirabe/src/command/create_project_command.rs b/crates/shirabe/src/command/create_project_command.rs index dbc98dd..ab45400 100644 --- a/crates/shirabe/src/command/create_project_command.rs +++ b/crates/shirabe/src/command/create_project_command.rs @@ -372,11 +372,11 @@ impl CreateProjectCommand { && add_repository { for (index, repo) in repos.iter().enumerate() { - let config = crate::command::composer_full(&composer_handle).get_config(); + let config = crate::composer::composer_full(&composer_handle).get_config(); let repo_config = RepositoryFactory::config_from_string(io.clone(), &config, repo, true)?; let composer_json_repositories_config = - crate::command::composer_full(&composer_handle) + crate::composer::composer_full(&composer_handle) .get_config() .borrow() .get_repositories(); @@ -426,7 +426,7 @@ impl CreateProjectCommand { } } - let composer = crate::command::composer_full_mut(&composer_handle); + let composer = crate::composer::composer_full(&composer_handle); let process = composer .get_loop() @@ -804,7 +804,7 @@ impl CreateProjectCommand { disable_plugins, Some(disable_scripts), )?; - let composer = crate::command::composer_full(&composer_handle); + let composer = crate::composer::composer_full(&composer_handle); let config = composer.get_config(); // set the base dir here again on the new config instance, as otherwise in case the vendor dir is defined in an env var for example it would still override the value set above by $config->all() config.borrow_mut().set_base_dir(Some(directory.clone())); -- cgit v1.3.1