feat: optimize --skip-decrypt-file

This commit is contained in:
2023-10-17 23:51:48 +08:00
parent 186330fe2c
commit 6e00247bf6

View File

@@ -130,11 +130,6 @@ pub fn decrypt_single(config: &Option<TinyEncryptConfig>,
let enc_meta = parse_encrypted_meta(&meta, &key.0, &nonce.0)?;
parse_encrypted_comment(&meta, &key.0, &nonce.0)?;
if cmd_decrypt.skip_decrypt_file {
information!("Decrypt file is skipped.");
return Ok(0);
}
// Decrypt to output
if cmd_decrypt.direct_print {
if meta.file_length > 10 * 1024 {
@@ -164,6 +159,11 @@ pub fn decrypt_single(config: &Option<TinyEncryptConfig>,
return Ok(meta.file_length);
}
if cmd_decrypt.skip_decrypt_file {
information!("Decrypt file content is skipped.");
return Ok(0);
}
// Decrypt to file
let compressed_desc = iff!(meta.compress, " [compressed]", "");
let start = Instant::now();