diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-20 08:33:49 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-20 08:33:57 +0900 |
| commit | f31b101ce1e921a026ba234b1f0a83b0392bc118 (patch) | |
| tree | b7ac2aa84d71ebd162cc21aeab0240e7e0544988 /crates/shirabe/src/downloader/download_manager.rs | |
| parent | 5e31fa33c3b5cf726a57a063b8e7a070869250fe (diff) | |
| download | php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.gz php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.zst php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.zip | |
fix(compile): fix all remaining compile errors
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/downloader/download_manager.rs')
| -rw-r--r-- | crates/shirabe/src/downloader/download_manager.rs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/crates/shirabe/src/downloader/download_manager.rs b/crates/shirabe/src/downloader/download_manager.rs index ea2ee1e..630f16d 100644 --- a/crates/shirabe/src/downloader/download_manager.rs +++ b/crates/shirabe/src/downloader/download_manager.rs @@ -158,7 +158,7 @@ impl DownloadManager { message: sprintf( "Downloader \"%s\" is a %s type downloader and can not be used to download %s for package %s", &[ - PhpMixed::String(get_class(downloader)), + PhpMixed::String(shirabe_php_shim::get_class_obj(downloader)), PhpMixed::String(downloader.get_installation_source()), PhpMixed::String(installation_source.unwrap_or("").to_string()), PhpMixed::String(package.to_string()), @@ -273,9 +273,12 @@ impl DownloadManager { // PHP: $result->then(static fn ($res) => $res, $handleError); // TODO(phase-b): chain $handleError as the rejection handler on the promise - let res = result.then(Box::new(move |res: PhpMixed| -> Result<PhpMixed> { - Ok(res) - })); + let res = result.then( + Some(Box::new(move |res: Option<PhpMixed>| -> Option<PhpMixed> { + res + })), + None, + ); return Ok(res); } @@ -384,12 +387,15 @@ impl DownloadManager { let promise = initial_downloader.unwrap().remove2(initial, &target_dir)?; let target_dir_owned = target_dir.clone(); - // TODO(phase-b): capture self and target into the closure - Ok(promise.then(Box::new( - move |_res: PhpMixed| -> Result<Box<dyn PromiseInterface>> { + // TODO(phase-b): capture self and target into the closure; type mismatch with then signature. + let _ = target_dir_owned; + Ok(promise.then( + Some(Box::new(move |res: Option<PhpMixed>| -> Option<PhpMixed> { + let _ = res; todo!("self.install(target, &target_dir_owned)") - }, - ))) + })), + None, + )) } /// Removes package from target dir. |
