feat: optimize code

This commit is contained in:
2023-11-05 21:12:01 +08:00
parent 5ec12237d9
commit 42a7a0fb28
4 changed files with 3 additions and 5 deletions

View File

@@ -210,7 +210,7 @@ pub fn decrypt_single(config: &Option<TinyEncryptConfig>,
Ok(meta.file_length)
}
fn decrypt_file(file_in: &mut File, file_len: u64, file_out: &mut impl Write,
fn decrypt_file(file_in: &mut impl Read, file_len: u64, file_out: &mut impl Write,
cryptor: Cryptor, key_nonce: &KeyNonce, compress: bool) -> XResult<u64> {
let mut total_len = 0_u64;
let mut buffer = [0u8; 1024 * 8];