Support for any PkgFmt in AsyncFileWriter

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-09 01:20:37 +10:00
parent 58c775a648
commit c3b5cb11c2
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
2 changed files with 50 additions and 24 deletions

View file

@ -68,7 +68,7 @@ pub async fn download<P: AsRef<Path>>(url: &str, path: P) -> Result<(), Binstall
debug!("Downloading to file: '{}'", path.display());
let mut bytes_stream = resp.bytes_stream();
let mut writer = AsyncFileWriter::new(path);
let mut writer = AsyncFileWriter::new(path, PkgFmt::Bin);
while let Some(res) = bytes_stream.next().await {
writer.write(res?).await?;