diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-02-07 12:35:33 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-02-08 09:37:04 +0100 |
commit | d319579fc89b5ac09f10abf4bfc77c21b0fc65ce (patch) | |
tree | e4fb352f3c1cd98383955d08c20fc0d311db51b7 /src/job/resource.rs | |
parent | 31fb8c89fefd3167b8b928cd75ddc008da60b434 (diff) |
Remove `Artifact` type
This patch follows-up on the shrinking of the `Artifact` type and removes it
entirely.
The type is not needed. Only the `ArtifactPath` type is needed, which is a thin
wrapper around `PathBuf`, ensuring that the path is relative to the store root.
The `Artifact` type used `pom` to parse the name and version of the package from
the `ArtifactPath` object it contained, which resulted in the restriction that
the path must always be
<name>-<version>...
Which should not be a requirement and actually caused issues with a package
named "foo-bar" (as an example).
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/job/resource.rs')
-rw-r--r-- | src/job/resource.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/job/resource.rs b/src/job/resource.rs index d4fa654..d657599 100644 --- a/src/job/resource.rs +++ b/src/job/resource.rs @@ -8,13 +8,13 @@ // SPDX-License-Identifier: EPL-2.0 // -use crate::filestore::Artifact; +use crate::filestore::ArtifactPath; use crate::util::EnvironmentVariableName; #[derive(Clone, Debug)] pub enum JobResource { Environment(EnvironmentVariableName, String), - Artifact(Artifact), + Artifact(ArtifactPath), } impl From<(EnvironmentVariableName, String)> for JobResource { @@ -23,8 +23,8 @@ impl From<(EnvironmentVariableName, String)> for JobResource { } } -impl From<Artifact> for JobResource { - fn from(a: Artifact) -> Self { +impl From<ArtifactPath> for JobResource { + fn from(a: ArtifactPath) -> Self { JobResource::Artifact(a) } } @@ -36,7 +36,7 @@ impl JobResource { _ => None, } } - pub fn artifact(&self) -> Option<&Artifact> { + pub fn artifact(&self) -> Option<&ArtifactPath> { match self { JobResource::Artifact(a) => Some(a), _ => None, |