feat: extract arch
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-11-26 22:46:34 +01:00
parent 7a1ad63b57
commit 3c28b30f8f
4 changed files with 67 additions and 29 deletions

View File

@@ -83,8 +83,6 @@ impl DaggerMiddleware for CargoBInstall {
pub trait CargoBInstallExt {
fn with_cargo_binstall(
&mut self,
arch: Architecture,
os: Os,
version: impl Into<String>,
crates: impl IntoIterator<Item = impl Into<String>>,
) -> &mut Self {
@@ -95,15 +93,13 @@ pub trait CargoBInstallExt {
impl CargoBInstallExt for RustService {
fn with_cargo_binstall(
&mut self,
arch: Architecture,
os: Os,
version: impl Into<String>,
crates: impl IntoIterator<Item = impl Into<String>>,
) -> &mut Self {
let crates: Vec<String> = crates.into_iter().map(|s| s.into()).collect();
self.with_stage(super::RustServiceStage::BeforeDeps(
Box::new(CargoBInstall::new(arch, os, version, crates))
Box::new(CargoBInstall::new(self.get_arch(), self.get_os(), version, crates))
))
}
}

View File

@@ -88,25 +88,15 @@ impl DaggerMiddleware for MoldInstall {
}
pub trait MoldActionExt {
fn with_mold(
&mut self,
architecture: Architecture,
os: Os,
version: impl Into<String>,
) -> &mut Self {
fn with_mold(&mut self, version: impl Into<String>) -> &mut Self {
self
}
}
impl MoldActionExt for RustService {
fn with_mold(
&mut self,
architecture: Architecture,
os: Os,
version: impl Into<String>,
) -> &mut Self {
fn with_mold(&mut self, version: impl Into<String>) -> &mut Self {
self.with_stage(super::RustServiceStage::AfterDeps(
Box::new(MoldInstall::new(architecture, os, version))
Box::new(MoldInstall::new(self.get_arch(), self.get_os(), version))
))
}
}