Move temporary downloads to XDG_CACHE/Downloads.

This commit is contained in:
Jordan Petridis 2018-01-07 07:46:11 +02:00
parent 6bd391d89e
commit 5c333291e1
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6

View File

@ -44,7 +44,7 @@ fn download_into(dir: &str, file_title: &str, url: &str) -> Result<String> {
// 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.