mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 23:24:35 +01:00
cleanup
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user