From d0866c96a250078c23d2916598da2411993a8892 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 22 Feb 2026 23:40:16 +0900 Subject: fix(fund): use 4-space JSON indentation to match Composer Composer's JsonFile::encode uses JSON_PRETTY_PRINT with 4-space indent. Mozart was using serde_json::to_string_pretty which defaults to 2-space. Co-Authored-By: Claude Opus 4.6 --- crates/mozart/src/commands/fund.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/mozart/src/commands/fund.rs b/crates/mozart/src/commands/fund.rs index 181e6e0..36c9325 100644 --- a/crates/mozart/src/commands/fund.rs +++ b/crates/mozart/src/commands/fund.rs @@ -1,4 +1,5 @@ use clap::Args; +use serde::Serialize; use std::collections::BTreeMap; use std::path::{Path, PathBuf}; @@ -217,7 +218,11 @@ fn render_text(grouped: &BTreeMap>>) { } fn render_json(grouped: &BTreeMap>>) -> anyhow::Result<()> { - println!("{}", serde_json::to_string_pretty(grouped)?); + let buf = Vec::new(); + let formatter = serde_json::ser::PrettyFormatter::with_indent(b" "); + let mut ser = serde_json::Serializer::with_formatter(buf, formatter); + grouped.serialize(&mut ser)?; + println!("{}", String::from_utf8(ser.into_inner())?); Ok(()) } -- cgit v1.3.1