From e068a9d644fde6659a88accd55b3f1d0d9d7cf46 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 23 May 2026 03:07:15 +0900 Subject: 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>> -> Result>). 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 --- crates/shirabe/src/package/version/version_guesser.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/shirabe/src/package') diff --git a/crates/shirabe/src/package/version/version_guesser.rs b/crates/shirabe/src/package/version/version_guesser.rs index 51a54e0..79f9d6d 100644 --- a/crates/shirabe/src/package/version/version_guesser.rs +++ b/crates/shirabe/src/package/version/version_guesser.rs @@ -518,6 +518,10 @@ impl VersionGuesser { strnatcasecmp(b, a) }); + // TODO(phase-c-promise): execute_async is now async; the .then continuation captures and mutates shared + // state (last_index, length, version, pretty_version, promises) and cancels sibling promises, while the + // loop is driven by process.wait(). This concurrent job/cancellation machinery needs design before it can + // become an await-based form, so the promise body (including the inner todo!()) is left as-is. let mut promises: Vec< Box, > = vec![]; -- cgit v1.3.1