feat: updates

This commit is contained in:
2023-09-07 08:43:12 +08:00
parent 1230601ed2
commit 3a4af50e27
3 changed files with 8 additions and 4 deletions

View File

@@ -18,8 +18,7 @@ pub fn decrypt(path: &PathBuf, pin: &Option<String>) -> XResult<()> {
return simple_error!("File is not tiny encrypt file: {}", &path_display);
}
let mut file_in = opt_result!(File::open(path), "Open file: {} failed: {}", &path_display);
let mut meta = opt_result!(file::read_tiny_encrypt_meta(&mut file_in), "Read file: {}, failed: {}", &path_display);
meta.normalize();
let meta = opt_result!(file::read_tiny_encrypt_meta_and_normalize(&mut file_in), "Read file: {}, failed: {}", &path_display);
let path_out = &path_display[0..path_display.len() - TINY_ENC_FILE_EXT.len()];
if let Ok(_) = fs::metadata(path_out) {