Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
harshdoesdev committed Oct 3, 2023
1 parent a7157e6 commit d2d6dda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/commands/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pub async fn download(

println!("Looking for artifacts...");

let mut output_exists_req = remote_client.exists(FASTN_VERCEL_REMOTE_BUILD_HASH.to_string(), None)?;

let mut output_exists_req =
remote_client.exists(FASTN_VERCEL_REMOTE_BUILD_HASH.to_string(), None)?;
let output_artifact_exists = output_exists_req.send().await?;

if output_artifact_exists {
Expand All @@ -33,16 +33,16 @@ pub async fn download(
println!("Downloading .output artifact");

let mut output_dir_archive = tempfile::tempfile()?;

let mut output_get_req = remote_client.get(FASTN_VERCEL_REMOTE_BUILD_HASH.to_string(), None)?;

let output_get_res = output_get_req.get().await?;

println!("Downloaded .output artifact");

output_dir_archive.write_all(&output_get_res.bytes().await?.to_vec())?;

output_dir_archive.seek(std::io::SeekFrom::Start(0)).unwrap();
output_dir_archive
.seek(std::io::SeekFrom::Start(0))
.unwrap();

vercel_cache_helper::utils::extract_tar_gz(output_dir_archive, &output_dir)?;

Expand Down
5 changes: 3 additions & 2 deletions src/commands/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ pub async fn upload(

vercel_cache_helper::utils::create_tar_gz_archive(&output_dir, &output_dir_archive)?;

output_dir_archive.seek(std::io::SeekFrom::Start(0)).unwrap();
output_dir_archive
.seek(std::io::SeekFrom::Start(0))
.unwrap();

let mut output_archive_buf: Vec<u8> = Vec::new();

let output_archive_size = output_dir_archive.read_to_end(&mut output_archive_buf)?;

println!("Output archive bytes read: {} bytes", output_archive_size);
Expand Down

0 comments on commit d2d6dda

Please sign in to comment.