diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-23 03:07:15 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-23 15:48:00 +0900 |
| commit | e068a9d644fde6659a88accd55b3f1d0d9d7cf46 (patch) | |
| tree | bb719a70eb8c840957a94a5601df8961055ceb0f /crates/shirabe/src/installer/noop_installer.rs | |
| parent | 60eb89529c8af2e4477e0bb65ed9e0f2dc7d3dd7 (diff) | |
| download | php-shirabe-e068a9d644fde6659a88accd55b3f1d0d9d7cf46.tar.gz php-shirabe-e068a9d644fde6659a88accd55b3f1d0d9d7cf46.tar.zst php-shirabe-e068a9d644fde6659a88accd55b3f1d0d9d7cf46.zip | |
refactor(promise): rewrite promise bodies to async/await
Mechanically convert promise-returning function bodies to async/await:
resolve() returns the value directly, forwarding calls get .await, and
simple .then chains become await sequences. Also collapse the installer
double-Option (Result<Option<Option<PhpMixed>>> -> Result<Option<PhpMixed>>).
Hard spots that depend on the Loop::wait / job-machine boundary
(accept/reject orchestration, closures capturing &mut self, batch waits)
are left intact and marked with TODO(phase-c-promise) for manual porting.
The crate does not compile yet; traits still need #[async_trait].
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/installer/noop_installer.rs')
| -rw-r--r-- | crates/shirabe/src/installer/noop_installer.rs | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/crates/shirabe/src/installer/noop_installer.rs b/crates/shirabe/src/installer/noop_installer.rs index 263caca..68e4ef8 100644 --- a/crates/shirabe/src/installer/noop_installer.rs +++ b/crates/shirabe/src/installer/noop_installer.rs @@ -26,9 +26,7 @@ impl InstallerInterface for NoopInstaller { _package: &dyn PackageInterface, _prev_package: Option<&dyn PackageInterface>, ) -> anyhow::Result<Option<PhpMixed>> { - Ok(Some(shirabe_external_packages::react::promise::resolve( - None, - ))) + Ok(None) } async fn prepare( @@ -37,9 +35,7 @@ impl InstallerInterface for NoopInstaller { _package: &dyn PackageInterface, _prev_package: Option<&dyn PackageInterface>, ) -> anyhow::Result<Option<PhpMixed>> { - Ok(Some(shirabe_external_packages::react::promise::resolve( - None, - ))) + Ok(None) } async fn cleanup( @@ -48,9 +44,7 @@ impl InstallerInterface for NoopInstaller { _package: &dyn PackageInterface, _prev_package: Option<&dyn PackageInterface>, ) -> anyhow::Result<Option<PhpMixed>> { - Ok(Some(shirabe_external_packages::react::promise::resolve( - None, - ))) + Ok(None) } async fn install( @@ -62,9 +56,7 @@ impl InstallerInterface for NoopInstaller { repo.add_package(package.clone_package_box()); } - Ok(Some(shirabe_external_packages::react::promise::resolve( - None, - ))) + Ok(None) } async fn update( @@ -86,9 +78,7 @@ impl InstallerInterface for NoopInstaller { repo.add_package(target.clone_package_box()); } - Ok(Some(shirabe_external_packages::react::promise::resolve( - None, - ))) + Ok(None) } async fn uninstall( @@ -105,9 +95,7 @@ impl InstallerInterface for NoopInstaller { } repo.remove_package(package); - Ok(Some(shirabe_external_packages::react::promise::resolve( - None, - ))) + Ok(None) } fn get_install_path(&self, package: &dyn PackageInterface) -> Option<String> { |
