Skip to content

Commit

Permalink
Convert output to serde_json::Value before printing
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Nov 2, 2024
1 parent b878e16 commit 4b3cc55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/subcommands/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ pub fn json(
let stdout = std::io::stdout();
let handle = stdout.lock();
if diffable {
serde_json::to_writer_pretty(handle, &output)?;
let value = serde_json::to_value(&output)?;
serde_json::to_writer_pretty(handle, &value)?;
} else {
serde_json::to_writer(handle, &output)?;
}
Expand Down

0 comments on commit 4b3cc55

Please sign in to comment.