Skip to content

Commit 5763c09

Browse files
committed
Remove RelPath::DOWNLOAD
1 parent 4f213ad commit 5763c09

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

build_system/abi_cafe.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::path::{Dirs, RelPath};
1+
use crate::path::Dirs;
22
use crate::prepare::GitRepo;
33
use crate::utils::{CargoProject, Compiler, spawn_and_wait};
44
use crate::{CodegenBackend, SysrootKind, build_sysroot};
@@ -20,7 +20,7 @@ pub(crate) fn run(
2020
rustup_toolchain_name: Option<&str>,
2121
bootstrap_host_compiler: &Compiler,
2222
) {
23-
RelPath::DOWNLOAD.ensure_exists(dirs);
23+
std::fs::create_dir_all(&dirs.download_dir).unwrap();
2424
ABI_CAFE_REPO.fetch(dirs);
2525
ABI_CAFE_REPO.patch(dirs);
2626

build_system/path.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub(crate) struct Dirs {
1414
#[derive(Debug, Copy, Clone)]
1515
pub(crate) enum PathBase {
1616
Source,
17-
Download,
1817
Build,
1918
Dist,
2019
}
@@ -23,7 +22,6 @@ impl PathBase {
2322
fn to_path(self, dirs: &Dirs) -> PathBuf {
2423
match self {
2524
PathBase::Source => dirs.source_dir.clone(),
26-
PathBase::Download => dirs.download_dir.clone(),
2725
PathBase::Build => dirs.build_dir.clone(),
2826
PathBase::Dist => dirs.dist_dir.clone(),
2927
}
@@ -38,7 +36,6 @@ pub(crate) enum RelPath {
3836

3937
impl RelPath {
4038
pub(crate) const SOURCE: RelPath = RelPath::Base(PathBase::Source);
41-
pub(crate) const DOWNLOAD: RelPath = RelPath::Base(PathBase::Download);
4239
pub(crate) const BUILD: RelPath = RelPath::Base(PathBase::Build);
4340
pub(crate) const DIST: RelPath = RelPath::Base(PathBase::Dist);
4441

build_system/prepare.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::path::{Dirs, RelPath};
88
use crate::utils::{copy_dir_recursively, ensure_empty_dir, spawn_and_wait};
99

1010
pub(crate) fn prepare(dirs: &Dirs) {
11-
RelPath::DOWNLOAD.ensure_exists(dirs);
11+
std::fs::create_dir_all(&dirs.download_dir).unwrap();
1212
crate::tests::RAND_REPO.fetch(dirs);
1313
crate::tests::REGEX_REPO.fetch(dirs);
1414
}
@@ -79,7 +79,7 @@ impl GitRepo {
7979

8080
fn download_dir(&self, dirs: &Dirs) -> PathBuf {
8181
match self.url {
82-
GitRepoUrl::Github { user: _, repo } => RelPath::DOWNLOAD.join(repo).to_path(dirs),
82+
GitRepoUrl::Github { user: _, repo } => dirs.download_dir.join(repo),
8383
}
8484
}
8585

0 commit comments

Comments
 (0)