diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-12-07 13:31:34 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-12-07 13:31:34 +0100 |
commit | d1badf8f02908478f50558e68f2a08b0e577979e (patch) | |
tree | c7a468c530a0cb471b9d0833b96d7b37dc940d59 /src/endpoint/configured.rs | |
parent | 17e907e1863d8fecf25edac01d81d595b45a9b69 (diff) |
Remove AsRef<Path> for FullArtifactPath impl
This patch removes the AsRef<Path> implementation for FullArtifactPath,
to make everything more explicit.
It also alters the FileStoreImpl implementation to contain a map of
ArtifactPath -> Artifact, rather than PathBuf -> Artifact, which is also
more type-safe than before this way.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/endpoint/configured.rs')
-rw-r--r-- | src/endpoint/configured.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/endpoint/configured.rs b/src/endpoint/configured.rs index df2aa77..4b359ad 100644 --- a/src/endpoint/configured.rs +++ b/src/endpoint/configured.rs @@ -266,11 +266,14 @@ impl Endpoint { .with_context(|| anyhow!("Collecting artifacts for copying to container {}", container_id))?; let destination = PathBuf::from("/inputs/").join(artifact_file_name); trace!("Copying {} to container: {}:{}", art.path().display(), container_id, destination.display()); - let buf = tokio::fs::read(staging.read().await.root_path().join(art.path())) + let buf = staging + .read() .await - .map(Vec::from) - .with_context(|| anyhow!("Reading artifact {}, so it can be copied to container", art.path().display())) - .map_err(Error::from)?; + .root_path() + .join(art.path()) + .read() + .await + .with_context(|| anyhow!("Reading artifact {}, so it can be copied to container", art.path().display()))?; let r = container.copy_file_into(&destination, &buf) .await |