Configure and run rustfmt

This commit is contained in:
Brian Bowman
2022-07-11 04:40:28 -05:00
parent 4d05063b61
commit e41a89b26c
10 changed files with 139 additions and 102 deletions

View File

@@ -23,21 +23,18 @@ pub fn unzip(window: tauri::Window, zipfile: String, destpath: String) {
match zip_extract::extract(&f, &full_path, true) {
Ok(_) => {
println!("Extracted zip file to: {}", full_path.to_str().unwrap_or("Error"));
println!(
"Extracted zip file to: {}",
full_path.to_str().unwrap_or("Error")
);
}
Err(e) => {
println!("Failed to extract zip file: {}", e);
let mut res_hash = std::collections::HashMap::new();
res_hash.insert(
"error".to_string(),
e.to_string(),
);
res_hash.insert("error".to_string(), e.to_string());
res_hash.insert(
"path".to_string(),
zipfile.to_string(),
);
res_hash.insert("path".to_string(), zipfile.to_string());
window.emit("download_error", &res_hash).unwrap();
}
@@ -50,7 +47,9 @@ pub fn unzip(window: tauri::Window, zipfile: String, destpath: String) {
// If the contents is a jar file, emit that we have extracted a new jar file
if name.ends_with(".jar") {
window.emit("jar_extracted", destpath.to_string() + name).unwrap();
window
.emit("jar_extracted", destpath.to_string() + name)
.unwrap();
}
// Delete zip file
@@ -65,4 +64,4 @@ pub fn unzip(window: tauri::Window, zipfile: String, destpath: String) {
window.emit("extract_end", &zipfile).unwrap();
});
}
}