This commit is contained in:
SpikeHD
2022-07-27 17:01:55 -07:00
parent 281bfb5cea
commit a843888cb8
3 changed files with 10 additions and 4 deletions

View File

@@ -18,7 +18,14 @@ pub fn rename(path: String, new_name: String) {
let path_replaced = &path.replace(&new_path.split('/').last().unwrap(), &new_name);
fs::rename(path, &path_replaced).unwrap();
match fs::rename(&path, &path_replaced) {
Ok(_) => {
println!("Renamed {} to {}", &path, path_replaced);
}
Err(e) => {
println!("Error: {}", e);
}
};
}
#[tauri::command]

View File

@@ -145,6 +145,5 @@ fn encrypt_metadata(old_data: &[u8]) -> Vec<u8> {
}
fn do_vecs_match<T: PartialEq>(a: &Vec<T>, b: &Vec<T>) -> bool {
let matching = a.iter().zip(b.iter()).filter(|&(a, b)| a == b).count();
matching == a.len() && matching == b.len()
a == b
}

View File

@@ -63,7 +63,7 @@ pub fn unzip(
println!("Is rar file? {}", zipfile.ends_with(".rar"));
let mut name = "".into();
let name;
// If file ends in zip, OR is unknown, extract as zip, otherwise extract as rar
if zipfile.ends_with(".rar") {