From 48945df40454ae5f11bf51a5c942bcbb32eb4854 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 17 Aug 2025 10:05:55 +0200 Subject: [PATCH] Fix: Allocate stdout only when necessary Signed-off-by: Matthias Beyer --- bin/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/main.rs b/bin/main.rs index d3f23655..dbe53510 100644 --- a/bin/main.rs +++ b/bin/main.rs @@ -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 {