From eb6d5247fc0f8c7203c9aaf6875f6b16681a9dd3 Mon Sep 17 00:00:00 2001 From: wjwei-handsome <56633839+wjwei-handsome@users.noreply.github.com> Date: Sat, 18 May 2024 20:08:30 +0800 Subject: [PATCH] fix normal file output --- src/utils.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils.rs b/src/utils.rs index d90ded6..c544c56 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -209,6 +209,8 @@ fn get_output_writer(outputpath: &str, rewrite: bool) -> Result, BUFFER_SIZE, bzip2::write::BzEncoder::new(file, bzip2::Compression::new(compression_level)), )) + } else if outputpath != "-" { + Box::new(BufWriter::with_capacity(BUFFER_SIZE, file)) } else { Box::new(BufWriter::new(stdout())) };