From 5c333291e1f8092fe6ea3ca33c7f52275b564929 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Sun, 7 Jan 2018 07:46:11 +0200 Subject: [PATCH] Move temporary downloads to XDG_CACHE/Downloads. --- hammond-downloader/src/downloader.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hammond-downloader/src/downloader.rs b/hammond-downloader/src/downloader.rs index 2f9e721..9980b9e 100644 --- a/hammond-downloader/src/downloader.rs +++ b/hammond-downloader/src/downloader.rs @@ -44,7 +44,7 @@ fn download_into(dir: &str, file_title: &str, url: &str) -> Result { // Construct a temp file to save desired content. // It has to be a `new_in` instead of new cause rename can't move cross filesystems. - let tempdir = TempDir::new_in(dir, "temp_download")?; + let tempdir = TempDir::new_in(HAMMOND_CACHE.to_str().unwrap(), "temp_download")?; let out_file = format!("{}/temp.part", tempdir.path().to_str().unwrap(),); // Save requested content into the file.