From e0b6df7c4644af5e1115f7e12abda994e90301f2 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Tue, 17 Oct 2023 00:03:07 +0800 Subject: [PATCH] feat: update do_write_file_out --- src/cmd_decrypt.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cmd_decrypt.rs b/src/cmd_decrypt.rs index 2a27672..7c28c82 100644 --- a/src/cmd_decrypt.rs +++ b/src/cmd_decrypt.rs @@ -128,8 +128,7 @@ pub fn decrypt_single(config: &Option, } let mut output: Vec = Vec::with_capacity(10 * 1024); let _ = decrypt_file( - &mut file_in, meta.file_length, &mut output, - &key, &nonce, meta.compress, + &mut file_in, meta.file_length, &mut output, &key, &nonce, meta.compress, )?; match String::from_utf8(output) { Err(_) => return simple_error!("File is not UTF-8 content."), @@ -138,8 +137,7 @@ pub fn decrypt_single(config: &Option, } else { let mut file_out = File::create(path_out)?; let _ = decrypt_file( - &mut file_in, meta.file_length, &mut file_out, - &key, &nonce, meta.compress, + &mut file_in, meta.file_length, &mut file_out, &key, &nonce, meta.compress, )?; drop(file_out); }