with out keeper

This commit is contained in:
Kasper Juul Hermansen 2023-01-27 08:40:21 +01:00
parent 997223eeaa
commit 59e59fd55d
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912

View File

@ -183,10 +183,7 @@ impl Downloader {
let resp = reqwest::blocking::get(&archive_url)?; let resp = reqwest::blocking::get(&archive_url)?;
let mut resp = resp.error_for_status()?; let mut resp = resp.error_for_status()?;
let temp = NamedTempFile::new()?; let temp = NamedTempFile::new()?;
let (file, path) = temp.keep()?; let mut buf_writer = BufWriter::new(temp);
println!("path: {:?}", path);
let mut buf_writer = BufWriter::new(file);
let mut bytes = vec![]; let mut bytes = vec![];
let _ = resp.read_to_end(&mut bytes)?; let _ = resp.read_to_end(&mut bytes)?;
buf_writer.write_all(bytes.as_slice())?; buf_writer.write_all(bytes.as_slice())?;