aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/installer/noop_installer.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-22 23:14:27 +0900
committernsfisis <nsfisis@gmail.com>2026-05-23 15:48:00 +0900
commit5adc4e467f01865ba2d4f519334ee1b0496b8ebf (patch)
treef6970f181793c0f8b9b67b2af54c09ae13a25c4b /crates/shirabe/src/installer/noop_installer.rs
parent2a1696906344cb4da768a940bf8b1f89bbc82b47 (diff)
downloadphp-shirabe-5adc4e467f01865ba2d4f519334ee1b0496b8ebf.tar.gz
php-shirabe-5adc4e467f01865ba2d4f519334ee1b0496b8ebf.tar.zst
php-shirabe-5adc4e467f01865ba2d4f519334ee1b0496b8ebf.zip
refactor(promise): change functions returning PromiseInterface to async fn
Diffstat (limited to 'crates/shirabe/src/installer/noop_installer.rs')
-rw-r--r--crates/shirabe/src/installer/noop_installer.rs27
1 files changed, 13 insertions, 14 deletions
diff --git a/crates/shirabe/src/installer/noop_installer.rs b/crates/shirabe/src/installer/noop_installer.rs
index 360f962..263caca 100644
--- a/crates/shirabe/src/installer/noop_installer.rs
+++ b/crates/shirabe/src/installer/noop_installer.rs
@@ -3,8 +3,7 @@
use crate::installer::InstallerInterface;
use crate::package::PackageInterface;
use crate::repository::InstalledRepositoryInterface;
-use shirabe_external_packages::react::promise::PromiseInterface;
-use shirabe_php_shim::InvalidArgumentException;
+use shirabe_php_shim::{InvalidArgumentException, PhpMixed};
#[derive(Debug)]
pub struct NoopInstaller;
@@ -22,43 +21,43 @@ impl InstallerInterface for NoopInstaller {
repo.has_package(package)
}
- fn download(
+ async fn download(
&self,
_package: &dyn PackageInterface,
_prev_package: Option<&dyn PackageInterface>,
- ) -> anyhow::Result<Option<Box<dyn PromiseInterface>>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
Ok(Some(shirabe_external_packages::react::promise::resolve(
None,
)))
}
- fn prepare(
+ async fn prepare(
&self,
_type: &str,
_package: &dyn PackageInterface,
_prev_package: Option<&dyn PackageInterface>,
- ) -> anyhow::Result<Option<Box<dyn PromiseInterface>>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
Ok(Some(shirabe_external_packages::react::promise::resolve(
None,
)))
}
- fn cleanup(
+ async fn cleanup(
&self,
_type: &str,
_package: &dyn PackageInterface,
_prev_package: Option<&dyn PackageInterface>,
- ) -> anyhow::Result<Option<Box<dyn PromiseInterface>>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
Ok(Some(shirabe_external_packages::react::promise::resolve(
None,
)))
}
- fn install(
+ async fn install(
&mut self,
repo: &mut dyn InstalledRepositoryInterface,
package: &dyn PackageInterface,
- ) -> anyhow::Result<Option<Box<dyn PromiseInterface>>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
if !repo.has_package(package) {
repo.add_package(package.clone_package_box());
}
@@ -68,12 +67,12 @@ impl InstallerInterface for NoopInstaller {
)))
}
- fn update(
+ async fn update(
&mut self,
repo: &mut dyn InstalledRepositoryInterface,
initial: &dyn PackageInterface,
target: &dyn PackageInterface,
- ) -> anyhow::Result<Option<Box<dyn PromiseInterface>>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
if !repo.has_package(initial) {
return Err(InvalidArgumentException {
message: format!("Package is not installed: {}", initial),
@@ -92,11 +91,11 @@ impl InstallerInterface for NoopInstaller {
)))
}
- fn uninstall(
+ async fn uninstall(
&mut self,
repo: &mut dyn InstalledRepositoryInterface,
package: &dyn PackageInterface,
- ) -> anyhow::Result<Option<Box<dyn PromiseInterface>>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
if !repo.has_package(package) {
return Err(InvalidArgumentException {
message: format!("Package is not installed: {}", package),