From 971824aa15334fd12d08ae0f441f6bf6079344c3 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 7 Jun 2026 10:33:53 +0900 Subject: feat(shirabe): resolve phase-b TODOs with shared ownership Replace TODO(phase-b) placeholders (todo!() and commented-out code) with real implementations: - Share JsonFile via Rc> so JsonConfigSource and the owning command can hold the same instance (base_config_command, config_command, repository_command, require_command, create_project, remove_command, factory) - Change InstallerInterface methods (is_installed, download, prepare, cleanup, get_install_path) to &mut self so initialize_vendor_dir can run, propagated to all installer implementations - Pass io/config/filesystem/process by clone instead of moving or stubbing (auth_helper, svn_driver, curl_downloader, library_installer) - Make TransportException Clone and store it by value in VcsRepository - Clone operations in Transaction sort, root_aliases/temporary_constraints in RepositorySet::create_pool, and share CompletePackage via handle in PlatformRepository - Wire up set_option, set_requires/set_dev_requires, installation manager setters, BumpCommand::set_composer, and clean_backups/set_local_phar --- crates/shirabe/src/command/self_update_command.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'crates/shirabe/src/command/self_update_command.rs') diff --git a/crates/shirabe/src/command/self_update_command.rs b/crates/shirabe/src/command/self_update_command.rs index 2353d13..9c5ae5a 100644 --- a/crates/shirabe/src/command/self_update_command.rs +++ b/crates/shirabe/src/command/self_update_command.rs @@ -646,19 +646,16 @@ RGv89BPD+2DLnJysngsvVaUCAwEAAQ==\n\ .as_bool() .unwrap_or(false) { - // TODO(phase-b): self.clean_backups conflicts with earlier `self.get_io()` borrow + self.clean_backups(&rollback_dir, None); } - // TODO(phase-b): self.set_local_phar mutable borrow conflicts with earlier `self.get_io()` borrow - let _set_phar_ok: bool = todo!("self.set_local_phar(...)"); - if !_set_phar_ok { + if !self.set_local_phar(&local_filename, &temp_filename, Some(&backup_file))? { // @unlink let _ = unlink(&temp_filename); return Ok(1); } - // TODO(phase-b): re-borrow io because earlier borrow conflicts with the &mut self calls above let io = self.get_io(); if file_exists(&backup_file) { io.write_error3( -- cgit v1.3.1