aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/downloader/hg_downloader.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-27 00:49:33 +0900
committernsfisis <nsfisis@gmail.com>2026-05-27 00:54:09 +0900
commitcc5d73c05a0abca2eebcc8a6afa0b1543ee49850 (patch)
tree091a0d01232d927f13f3ab22700701804980f231 /crates/shirabe/src/downloader/hg_downloader.rs
parentc5850d62beabef0a6bcc4cf6a179589c0ba8f405 (diff)
downloadphp-shirabe-cc5d73c05a0abca2eebcc8a6afa0b1543ee49850.tar.gz
php-shirabe-cc5d73c05a0abca2eebcc8a6afa0b1543ee49850.tar.zst
php-shirabe-cc5d73c05a0abca2eebcc8a6afa0b1543ee49850.zip
refactor(package): pass package handles by value throughout
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/downloader/hg_downloader.rs')
-rw-r--r--crates/shirabe/src/downloader/hg_downloader.rs34
1 files changed, 17 insertions, 17 deletions
diff --git a/crates/shirabe/src/downloader/hg_downloader.rs b/crates/shirabe/src/downloader/hg_downloader.rs
index d4c53f3..7a48054 100644
--- a/crates/shirabe/src/downloader/hg_downloader.rs
+++ b/crates/shirabe/src/downloader/hg_downloader.rs
@@ -5,7 +5,7 @@ use crate::downloader::DownloaderInterface;
use crate::downloader::VcsDownloaderBase;
use crate::io::IOInterface;
use crate::io::IOInterfaceImmutable;
-use crate::package::PackageInterface;
+use crate::package::PackageInterfaceHandle;
use crate::util::Filesystem;
use crate::util::Hg as HgUtils;
use crate::util::ProcessExecutor;
@@ -31,10 +31,10 @@ impl HgDownloader {
pub(crate) async fn do_download(
&self,
- package: &dyn PackageInterface,
+ package: PackageInterfaceHandle,
path: String,
url: String,
- prev_package: Option<&dyn PackageInterface>,
+ prev_package: Option<PackageInterfaceHandle>,
) -> Result<Option<PhpMixed>> {
if HgUtils::get_version(&self.inner.process).is_none() {
return Err(RuntimeException {
@@ -49,7 +49,7 @@ impl HgDownloader {
pub(crate) async fn do_install(
&self,
- package: &dyn PackageInterface,
+ package: PackageInterfaceHandle,
path: String,
url: String,
) -> Result<Option<PhpMixed>> {
@@ -103,8 +103,8 @@ impl HgDownloader {
pub(crate) async fn do_update(
&self,
- initial: &dyn PackageInterface,
- target: &dyn PackageInterface,
+ initial: PackageInterfaceHandle,
+ target: PackageInterfaceHandle,
path: String,
url: String,
) -> Result<Option<PhpMixed>> {
@@ -154,7 +154,7 @@ impl HgDownloader {
pub fn get_local_changes(
&self,
- package: &dyn PackageInterface,
+ package: PackageInterfaceHandle,
path: String,
) -> Option<String> {
if !std::path::Path::new(&format!("{}/.hg", path)).is_dir() {
@@ -229,9 +229,9 @@ impl DownloaderInterface for HgDownloader {
async fn download(
&self,
- _package: &dyn PackageInterface,
+ _package: PackageInterfaceHandle,
_path: &str,
- _prev_package: Option<&dyn PackageInterface>,
+ _prev_package: Option<PackageInterfaceHandle>,
_output: bool,
) -> Result<Option<PhpMixed>> {
todo!()
@@ -240,16 +240,16 @@ impl DownloaderInterface for HgDownloader {
async fn prepare(
&self,
_type: &str,
- _package: &dyn PackageInterface,
+ _package: PackageInterfaceHandle,
_path: &str,
- _prev_package: Option<&dyn PackageInterface>,
+ _prev_package: Option<PackageInterfaceHandle>,
) -> Result<Option<PhpMixed>> {
todo!()
}
async fn install(
&self,
- _package: &dyn PackageInterface,
+ _package: PackageInterfaceHandle,
_path: &str,
_output: bool,
) -> Result<Option<PhpMixed>> {
@@ -258,8 +258,8 @@ impl DownloaderInterface for HgDownloader {
async fn update(
&self,
- _initial: &dyn PackageInterface,
- _target: &dyn PackageInterface,
+ _initial: PackageInterfaceHandle,
+ _target: PackageInterfaceHandle,
_path: &str,
) -> Result<Option<PhpMixed>> {
todo!()
@@ -267,7 +267,7 @@ impl DownloaderInterface for HgDownloader {
async fn remove(
&self,
- _package: &dyn PackageInterface,
+ _package: PackageInterfaceHandle,
_path: &str,
_output: bool,
) -> Result<Option<PhpMixed>> {
@@ -277,9 +277,9 @@ impl DownloaderInterface for HgDownloader {
async fn cleanup(
&self,
_type: &str,
- _package: &dyn PackageInterface,
+ _package: PackageInterfaceHandle,
_path: &str,
- _prev_package: Option<&dyn PackageInterface>,
+ _prev_package: Option<PackageInterfaceHandle>,
) -> Result<Option<PhpMixed>> {
todo!()
}