Skip to content

Commit

Permalink
Reformat to pass checks
Browse files Browse the repository at this point in the history
  • Loading branch information
woutersl committed Aug 14, 2024
1 parent a3a2556 commit 9c95a98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
11 changes: 3 additions & 8 deletions src/services/storage/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,10 @@ impl<'config> Storage for FsStorage<'config> {
let name = &metadata.name;
let version = &metadata.vers;

self.write_to_file(&Self::data_path(name, version), &content)
.await?;
self.write_to_file(
&Self::metadata_path(name, version),
&metadata_json,
)
.await?;
self.write_to_file(&Self::readme_path(name, version), &readme)
self.write_to_file(&Self::data_path(name, version), &content).await?;
self.write_to_file(&Self::metadata_path(name, version), &metadata_json)
.await?;
self.write_to_file(&Self::readme_path(name, version), &readme).await?;
Ok(())
}

Expand Down
16 changes: 2 additions & 14 deletions src/services/storage/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,7 @@ impl<'config> Storage for S3Storage<'config> {
// bucket does not exist => create it
crate::utils::s3::create_bucket(self.params, self.bucket).await?;
}
crate::utils::s3::upload_object_raw(
self.params,
self.bucket,
&Self::data_key(name, version),
content,
)
.await?;
crate::utils::s3::upload_object_raw(self.params, self.bucket, &Self::data_key(name, version), content).await?;
// version data
crate::utils::s3::upload_object_raw(
self.params,
Expand All @@ -68,13 +62,7 @@ impl<'config> Storage for S3Storage<'config> {
serde_json::to_vec(metadata)?,
)
.await?;
crate::utils::s3::upload_object_raw(
self.params,
self.bucket,
&Self::readme_key(name, version),
readme,
)
.await?;
crate::utils::s3::upload_object_raw(self.params, self.bucket, &Self::readme_key(name, version), readme).await?;
Ok(())
}

Expand Down

0 comments on commit 9c95a98

Please sign in to comment.