Fix: Allocate stdout only when necessary

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer
2025-12-09 13:16:31 +01:00
committed by Erik Kundt
parent a1060c9801
commit 48945df404
+1 -1
View File
@@ -174,8 +174,8 @@ fn print_help() -> anyhow::Result<()> {
fn run(command: Command) -> Result<(), Error> {
match command {
Command::Version { json } => {
let mut stdout = io::stdout();
if json {
let mut stdout = io::stdout();
VERSION.write_json(&mut stdout)?;
println!();
} else {