diff options
Diffstat (limited to 'src/parallel.rs')
| -rw-r--r-- | src/parallel.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parallel.rs b/src/parallel.rs index a3a722b..aacd9c3 100644 --- a/src/parallel.rs +++ b/src/parallel.rs @@ -162,7 +162,7 @@ async fn download_one(url: &str, expected_sha: &str, _cfg: &Config) -> Result<Pa } let mut tmp_file = NamedTempFile::new().map_err(|e| e.to_string())?; - let file_path = tmp_file.path().to_path_buf(); + let _file_path = tmp_file.path().to_path_buf(); let mut hasher = Sha256::new(); let body = res.bytes().await.map_err(|e| e.to_string())?; @@ -179,8 +179,8 @@ async fn download_one(url: &str, expected_sha: &str, _cfg: &Config) -> Result<Pa } } - drop(tmp_file); - Ok(file_path) + let (_, path) = tmp_file.keep().map_err(|e| e.to_string())?; + Ok(path) }) .await .unwrap_or_else(|_| Err("Download timed out".into())); |