diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-19 00:10:22 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-19 00:11:03 +0900 |
| commit | c839244d8d09f3036ebfee8eef7eb6b147e593ab (patch) | |
| tree | fe48c94f2c2e62468beef5ff1a8f3cff6adeef4f /crates/shirabe/src/installer/project_installer.rs | |
| parent | 48839250146b217e2756ed3c0e624fd341b54d6c (diff) | |
| download | php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.gz php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.zst php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.zip | |
fix(compile): fix various compile errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/installer/project_installer.rs')
| -rw-r--r-- | crates/shirabe/src/installer/project_installer.rs | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/crates/shirabe/src/installer/project_installer.rs b/crates/shirabe/src/installer/project_installer.rs index 1a097b0..f8b0bba 100644 --- a/crates/shirabe/src/installer/project_installer.rs +++ b/crates/shirabe/src/installer/project_installer.rs @@ -11,13 +11,17 @@ use shirabe_php_shim::InvalidArgumentException; #[derive(Debug)] pub struct ProjectInstaller { install_path: String, - download_manager: DownloadManager, + download_manager: std::rc::Rc<std::cell::RefCell<DownloadManager>>, filesystem: Filesystem, } impl ProjectInstaller { - pub fn new(install_path: &str, dm: DownloadManager, fs: Filesystem) -> Self { - let install_path = format!("{}/", install_path.replace('\\', '/').trim_end_matches('/')); + pub fn new( + install_path: &str, + dm: std::rc::Rc<std::cell::RefCell<DownloadManager>>, + fs: Filesystem, + ) -> Self { + let install_path = format!("{}/", install_path.replace('\\', "/").trim_end_matches('/')); Self { install_path, download_manager: dm, @@ -59,7 +63,9 @@ impl InstallerInterface for ProjectInstaller { } self.download_manager + .borrow() .download(package, install_path, prev_package) + .map(Some) } fn prepare( @@ -69,7 +75,9 @@ impl InstallerInterface for ProjectInstaller { prev_package: Option<&dyn PackageInterface>, ) -> anyhow::Result<Option<Box<dyn PromiseInterface>>> { self.download_manager + .borrow() .prepare(r#type, package, &self.install_path, prev_package) + .map(Some) } fn cleanup( @@ -79,19 +87,23 @@ impl InstallerInterface for ProjectInstaller { prev_package: Option<&dyn PackageInterface>, ) -> anyhow::Result<Option<Box<dyn PromiseInterface>>> { self.download_manager + .borrow() .cleanup(r#type, package, &self.install_path, prev_package) + .map(Some) } fn install( - &self, + &mut self, _repo: &mut dyn InstalledRepositoryInterface, package: &dyn PackageInterface, ) -> anyhow::Result<Option<Box<dyn PromiseInterface>>> { - self.download_manager.install(package, &self.install_path) + self.download_manager + .borrow() + .install(package, &self.install_path) } fn update( - &self, + &mut self, _repo: &mut dyn InstalledRepositoryInterface, _initial: &dyn PackageInterface, _target: &dyn PackageInterface, @@ -104,7 +116,7 @@ impl InstallerInterface for ProjectInstaller { } fn uninstall( - &self, + &mut self, _repo: &mut dyn InstalledRepositoryInterface, _package: &dyn PackageInterface, ) -> anyhow::Result<Option<Box<dyn PromiseInterface>>> { |
