From d2d6dda660da8568bed3b8cb9b36b031226f3442 Mon Sep 17 00:00:00 2001 From: Harsh Singh Date: Tue, 3 Oct 2023 10:40:14 +0530 Subject: [PATCH] Code formatting --- src/commands/download.rs | 10 +++++----- src/commands/upload.rs | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/commands/download.rs b/src/commands/download.rs index 9b6a47b..d5fd766 100644 --- a/src/commands/download.rs +++ b/src/commands/download.rs @@ -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 { @@ -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)?; diff --git a/src/commands/upload.rs b/src/commands/upload.rs index 2f88ce1..a8c7c69 100644 --- a/src/commands/upload.rs +++ b/src/commands/upload.rs @@ -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 = 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);