chore: Merge branch v1 into v2 (#702)

This commit is contained in:
Fabian-Lars
2023-11-14 01:50:13 +01:00
committed by GitHub
parent d4d1633c4d
commit 251852ccbc
42 changed files with 1663 additions and 5522 deletions
+1 -1
View File
@@ -25,7 +25,7 @@
"LICENSE"
],
"devDependencies": {
"tslib": "2.6.0"
"tslib": "2.6.2"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.11"
+6 -2
View File
@@ -21,7 +21,10 @@ use tauri::{
plugin::{Builder as PluginBuilder, TauriPlugin},
Runtime,
};
use tokio::{fs::File, io::AsyncWriteExt};
use tokio::{
fs::File,
io::{AsyncWriteExt, BufWriter},
};
use tokio_util::codec::{BytesCodec, FramedRead};
use read_progress_stream::ReadProgressStream;
@@ -74,7 +77,7 @@ async fn download(
let response = request.send().await?;
let total = response.content_length().unwrap_or(0);
let mut file = File::create(file_path).await?;
let mut file = BufWriter::new(File::create(file_path).await?);
let mut stream = response.bytes_stream();
while let Some(chunk) = stream.try_next().await? {
@@ -84,6 +87,7 @@ async fn download(
total,
});
}
file.flush().await?;
Ok(())
}