aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-core/src/downloader/hg_downloader.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mozart-core/src/downloader/hg_downloader.rs')
-rw-r--r--crates/mozart-core/src/downloader/hg_downloader.rs17
1 files changed, 13 insertions, 4 deletions
diff --git a/crates/mozart-core/src/downloader/hg_downloader.rs b/crates/mozart-core/src/downloader/hg_downloader.rs
index 9fb918e..dfe3546 100644
--- a/crates/mozart-core/src/downloader/hg_downloader.rs
+++ b/crates/mozart-core/src/downloader/hg_downloader.rs
@@ -1,16 +1,19 @@
+use crate::downloader::{DownloaderInterface, VcsDownloader};
+use crate::vcs::process::ProcessExecutor;
+use crate::vcs::util::hg::HgUtil;
use anyhow::Result;
use std::path::Path;
-use crate::{downloader::VcsDownloader, vcs::util::hg::HgUtil};
-
/// Mercurial downloader using clone/pull/update.
pub struct HgDownloader {
hg_util: HgUtil,
}
impl HgDownloader {
- pub fn new(hg_util: HgUtil) -> Self {
- Self { hg_util }
+ pub fn new(process: ProcessExecutor) -> Self {
+ Self {
+ hg_util: HgUtil::new(process),
+ }
}
}
@@ -82,3 +85,9 @@ impl VcsDownloader for HgDownloader {
false
}
}
+
+impl DownloaderInterface for HgDownloader {
+ fn as_vcs_downloader(&self) -> Option<&dyn VcsDownloader> {
+ Some(self)
+ }
+}