download stop button

This commit is contained in:
SpikeHD
2022-05-12 20:32:06 -07:00
parent 8ba3e7022d
commit 3c8a3f2537
8 changed files with 61 additions and 25 deletions

View File

@@ -13,7 +13,7 @@ pub async fn download_file(window: tauri::Window, url: &str, path: &str) -> Resu
let res = match reqwest::get(url)
.await {
Ok(r) => r,
Err(e) => {
Err(_e) => {
emit_download_err(window, format!("Failed to request {}", url), url);
return Err(format!("Failed to request {}", url));
},
@@ -25,7 +25,7 @@ pub async fn download_file(window: tauri::Window, url: &str, path: &str) -> Resu
// Create file path
let mut file = match File::create(path) {
Ok(f) => f,
Err(e) => {
Err(_e) => {
emit_download_err(window, format!("Failed to create file '{}'", path), path);
return Err(format!("Failed to create file '{}'", path));
},